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

debianmacno-cupsnodebathenaweb
Last change on this file since 0237078 was 4ac44b2, checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago
  • More useful things in the README
  • Change perms to listen from everywhere
  • Conflict with pulseaudio, recommend removing bluez-alsa
  • Property mode set to 100755
File size: 930 bytes
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
26<Location /printers/$printername>
27    Order Deny, Allow
28    Allow from All
29</Location>
30
31Group audio
32Listen *
33
34# End configurations for gutenbach
35EOF
36
37    /etc/init.d/cups reload
38
39else
40    echo "Error: /usr/lib/gutenbach/config/printername does not exist"
41    exit 1
42fi
Note: See TracBrowser for help on using the repository browser.