source: server/inst/create-filter-config @ 7cdd65d

debianmacno-cups
Last change on this file since 7cdd65d was 55b24d1, checked in by Kyle Brogle <broglek@…>, 14 years ago

changed create-filter-config to use the mixer and channel settings from debconf

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/sh -e
2
3echo "Creating /usr/lib/gutenbach/config/gutenbach-filter-config.pl..." >&2
4if [ -e "/usr/lib/gutenbach/config/gutenbach-filter-config.pl" ]; then
5    rm /usr/lib/gutenbach/config/gutenbach-filter-config.pl
6fi
7
8failed=
9if [ -e /usr/lib/gutenbach/config/printername ]; then
10    printername=$(cat /usr/lib/gutenbach/config/printername)
11else
12    failed="yes"
13fi
14if [ -e /usr/lib/gutenbach/config/hostname ]; then
15    hostname=$(cat /usr/lib/gutenbach/config/hostname)
16else
17    failed="yes"
18fi
19if [ -e /usr/lib/gutenbach/config/zephyrclass ]; then
20    zephyrclass=$(cat /usr/lib/gutenbach/config/zephyrclass)
21else
22    failed="yes"
23fi
24if [ -e /usr/lib/gutenbach/remctl/config/mixer ]; then
25    mixer=$(cat /usr/lib/gutenbach/remctl/config/mixer)
26else
27    mixer="PCM"
28fi
29if [ -e /usr/lib/gutenbach/remctl/config/channel ]; then
30    channel=$(cat /usr/lib/gutenbach/remctl/config/channel)
31else
32    channel="Front Left"
33fi
34
35
36
37config_file="/usr/lib/gutenbach/config/gutenbach-filter-config.pl"
38
39if [ -z "$failed" ]; then
40    echo "\$zephyr_class = \""$zephyrclass"\";" >> "$config_file"
41    echo "\$host = \""$hostname"\";" >> "$config_file"
42    echo "\$queue = \""$printername"\";" >> "$config_file"
43    echo "\$mixer = \""$mixer"\";" >> "$config_file"
44    echo "\$channel = \""$channel"\";" >> "$config_file"
45    echo "1;" >> "$config_file"
46else
47    echo "Error: One of /usr/lib/gutenbach/config/{printername,hostname,zephyrclass} does not exist!" >&2
48    exit 1
49fi
Note: See TracBrowser for help on using the repository browser.