source: gutenbach/debian/rm/revert_printcap @ c631d1a

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

Changed 'sipbmp3' to 'gutenbach' by popular demand. Have not checked for errors, yet.

  • Property mode set to 100755
File size: 698 bytes
Line 
1#!/bin/sh -e
2
3echo "Reverting changes to /etc/printcap..." >&2
4. /usr/share/debconf/confmodule
5db_get gutenbach/printername
6
7mv /etc/printcap /etc/printcap.bak
8touch /etc/printcap
9foundprinter="false"
10while read line; do
11    printername=$(echo "$line" | grep ^`echo $RET`$ || true)
12    if [ -n "$printername" ]; then
13        foundprinter="true"
14    else
15        if [ "$foundprinter"="true" ]; then
16            configline=$(echo "$line" | grep ^[[:space:]]*: || true)
17            if [ -z "$configline" ]; then
18                foundprinter="false"
19                echo "$line" >> /etc/printcap
20            fi
21        else
22            echo "$line" >> /etc/printcap
23        fi
24    fi
25done < /etc/printcap.bak
26rm /etc/printcap.bak
Note: See TracBrowser for help on using the repository browser.