source: server/rm/revert_printcap @ 9c0279e

debianmacno-cupsweb
Last change on this file since 9c0279e 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: 868 bytes
Line 
1#!/bin/sh -e
2
3echo "Reverting changes to /etc/printcap..." >&2
4
5if [ -e /usr/lib/gutenbach/config/printername ]; then
6    printername=$(cat /usr/lib/gutenbach/config/printername)
7
8    mv /etc/printcap /etc/printcap.bak
9    touch /etc/printcap
10    foundprinter="false"
11    while read line; do
12        printername=$(echo "$line" | grep ^`echo $printername`$ || true)
13        if [ -n "$printername" ]; then
14            foundprinter="true"
15        else
16            if [ "$foundprinter"="true" ]; then
17                configline=$(echo "$line" | grep ^[[:space:]]*: || true)
18                if [ -z "$configline" ]; then
19                    foundprinter="false"
20                    echo "$line" >> /etc/printcap
21                fi
22            else
23                echo "$line" >> /etc/printcap
24            fi
25        fi
26    done < /etc/printcap.bak
27    rm /etc/printcap.bak
28else
29    echo "Error: /usr/lib/gutenbach/config/printername does not exist!" >&2
30fi
Note: See TracBrowser for help on using the repository browser.