source: server/rm/cups-revert-perms @ 30beeab

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: 717 bytes
Line 
1#!/bin/sh
2
3echo "Reverting changes to /etc/cups/cupsd.conf..." >&2
4conffile="/etc/cups/cupsd.conf"
5
6mv "$conffile" "$conffile.bak"
7touch "$conffile"
8sed '/# Begin configurations for gutenbach/,/# End configurations for gutenbach/ d' < "$conffile.bak" > "$conffile"
9
10mv "$conffile" "$conffile.bak"
11touch "$conffile"
12while read line; do
13    listen_localhost=$(echo "$line" | grep '^#GUTENBACH' || true)
14    if [ -n "$listen_localhost" ]; then
15        echo "$(echo $line | sed s/#GUTENBACH//)" >> "$conffile"
16    else
17        root_location=$(echo "$line" | grep '^Allow from All # added by Gutenbach$' || true)
18        if [ -z "$root_location" ]; then
19            echo "$line" >> "$conffile"
20        fi
21    fi
22
23done < "$conffile.bak"
24
25rm "$conffile.bak"
Note: See TracBrowser for help on using the repository browser.