#!/bin/sh -e echo "Creating /usr/lib/gutenbach/config/gutenbach-filter-config.pl..." >&2 if [ -e "/usr/lib/gutenbach/config/gutenbach-filter-config.pl" ]; then rm /usr/lib/gutenbach/config/gutenbach-filter-config.pl fi failed= if [ -e /usr/lib/gutenbach/config/printername ]; then printername=$(cat /usr/lib/gutenbach/config/printername) else failed="yes" fi if [ -e /usr/lib/gutenbach/config/hostname ]; then hostname=$(cat /usr/lib/gutenbach/config/hostname) else failed="yes" fi if [ -e /usr/lib/gutenbach/config/zephyrclass ]; then zephyrclass=$(cat /usr/lib/gutenbach/config/zephyrclass) else failed="yes" fi mixer="PCM" channel="Front Left" config_file="/usr/lib/gutenbach/config/gutenbach-filter-config.pl" if [ -z "$failed" ]; then echo "\$zephyr_class = \""$zephyrclass"\";" >> "$config_file" echo "\$host = \""$hostname"\";" >> "$config_file" echo "\$queue = \""$printername"\";" >> "$config_file" echo "\$mixer = \""$mixer"\";" >> "$config_file" echo "\$channel = \""$channel"\";" >> "$config_file" echo "1;" >> "$config_file" else echo "Error: One of /usr/lib/gutenbach/config/{printername,hostname,zephyrclass} does not exist!" >&2 exit 1 fi