source: debian/inst/cups-set-perms @ aef31c3

debianmacno-cupsnodebathenaweb
Last change on this file since aef31c3 was aef31c3, checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago

Fix print server permissions so users can use cups-lpq and cups-lprm

  • Property mode set to 100755
File size: 1.0 KB
Line 
1#!/bin/sh
2
3# Set the CUPS permissions such that anyone can add/remove jobs
4# from the queue for gutenbach.
5
6if [ -e /usr/lib/gutenbach/config/printername ]; then
7    printername="$(cat /usr/lib/gutenbach/config/printername)"
8
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
18            echo "$line" >> "$conffile"
19        fi
20    done < "$conffile.bak"
21    rm "$conffile.bak"
22
23    cat >> "$conffile" <<EOF
24# Begin configurations for gutenbach
25
26Group audio
27Listen *
28
29<Location /printers/$printername>
30    <Limit Cancel-Job Purge-Jobs CUPS-Authenticate-Job>
31        Order deny,allow
32        Allow from All
33    </Limit>
34
35    Order Deny, Allow
36    Allow from All
37</Location>
38
39# End configurations for gutenbach
40EOF
41
42    /etc/init.d/cups reload
43
44else
45    echo "Error: /usr/lib/gutenbach/config/printername does not exist"
46    exit 1
47fi
Note: See TracBrowser for help on using the repository browser.