source: debian/rm/revert_printcap @ 53e9374

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

Remove other submodules and move some things around

  • Property mode set to 100755
File size: 868 bytes
RevLine 
[331360d]1#!/bin/sh -e
2
3echo "Reverting changes to /etc/printcap..." >&2
4
[e4cb270]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.