debianmacno-cupsweb
Last change
on this file since 30beeab was
30beeab,
checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago
|
Remove "gutenbach-" from directory names and rename "gutenbach" to "gutenbach-server"
|
-
Property mode set to
100755
|
File size:
1.2 KB
|
Rev | Line | |
---|
[c503858] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | # Set the CUPS permissions such that anyone can add/remove jobs |
---|
| 4 | # from the queue for gutenbach. |
---|
| 5 | |
---|
| 6 | if [ -e /usr/lib/gutenbach/config/printername ]; then |
---|
| 7 | printername="$(cat /usr/lib/gutenbach/config/printername)" |
---|
| 8 | |
---|
[4ac44b2] | 9 | conffile="/etc/cups/cupsd.conf" |
---|
| 10 | mv "$conffile" "$conffile.bak" |
---|
| 11 | touch "$conffile" |
---|
| 12 | |
---|
| 13 | while read line; do |
---|
| 14 | listen_localhost=$(echo "$line" | grep '^Listen localhost' || true) |
---|
| 15 | if [ -n "$listen_localhost" ]; then |
---|
| 16 | echo "#GUTENBACH$line" >> "$conffile" |
---|
| 17 | else |
---|
[8045b0a] | 18 | root_location=$(echo "$line" | grep '^<Location />$' || true) |
---|
| 19 | if [ -n "$root_location" ]; then |
---|
| 20 | echo "<Location />" >> "$conffile" |
---|
| 21 | echo "Allow from All # added by Gutenbach" >> "$conffile" |
---|
| 22 | else |
---|
| 23 | echo "$line" >> "$conffile" |
---|
| 24 | fi |
---|
[4ac44b2] | 25 | fi |
---|
[8045b0a] | 26 | |
---|
[4ac44b2] | 27 | done < "$conffile.bak" |
---|
| 28 | rm "$conffile.bak" |
---|
| 29 | |
---|
| 30 | cat >> "$conffile" <<EOF |
---|
[4cd453f] | 31 | # Begin configurations for gutenbach |
---|
| 32 | |
---|
[aef31c3] | 33 | Group audio |
---|
| 34 | Listen * |
---|
[8045b0a] | 35 | ServerAlias * |
---|
[aef31c3] | 36 | |
---|
[c503858] | 37 | <Location /printers/$printername> |
---|
[aef31c3] | 38 | <Limit Cancel-Job Purge-Jobs CUPS-Authenticate-Job> |
---|
| 39 | Order deny,allow |
---|
| 40 | Allow from All |
---|
| 41 | </Limit> |
---|
| 42 | |
---|
[c503858] | 43 | Order Deny, Allow |
---|
| 44 | Allow from All |
---|
| 45 | </Location> |
---|
[4cd453f] | 46 | |
---|
| 47 | # End configurations for gutenbach |
---|
[c503858] | 48 | EOF |
---|
| 49 | |
---|
[4cd453f] | 50 | /etc/init.d/cups reload |
---|
| 51 | |
---|
[c503858] | 52 | else |
---|
| 53 | echo "Error: /usr/lib/gutenbach/config/printername does not exist" |
---|
| 54 | exit 1 |
---|
[4ac44b2] | 55 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.