source: debian/inst/edit-lpd.conf @ c94338b

debianmacno-cupsnodebathenaweb
Last change on this file since c94338b 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: 1.1 KB
Line 
1#!/bin/sh -e
2
3echo "Editing /etc/lprng/lpd.conf..." >&2
4# add the printcap path to lpd.conf
5if [ -e /etc/lprng/lpd.conf ]; then
6    mv /etc/lprng/lpd.conf /etc/lprng/lpd.conf.bak
7    touch /etc/lprng/lpd.conf   
8
9    while read line; do
10        printcap=$(echo "$line" | grep ^printcap_path= || true)
11        if [ -n "$printcap" ]; then
12            lprngprintcap=$(echo "$line" | grep /etc/lprng/printcap || true)
13            printcap=$(echo "$line" | grep /etc/printcap || true)
14            if [ ! -n "$lprngprintcap" ] && [ ! -n "$printcap" ]; then
15                echo "#$line" >> /etc/lprng/lpd.conf
16                echo "$line" | sed 's,printcap_path=,printcap_path=/etc/lprng/printcap:\|,' >> /etc/lprng/lpd.conf
17            else
18                echo "$line" >> /etc/lprng/lpd.conf
19            fi
20        else
21            echo "$line" >> /etc/lprng/lpd.conf
22        fi
23    done < /etc/lprng/lpd.conf.bak
24    rm /etc/lprng/lpd.conf.bak
25else
26    touch /etc/lprng/lpd.conf
27    echo "printcap_path=/etc/lprng/printcap" >> /etc/lprng/lpd.conf
28fi
29
30# add lpd_listen_port to lpd.conf
31lpd_listen_port=$(cat /etc/lprng/lpd.conf | grep ^lpd_listen_port=515 || true)
32if [ ! -n "$lpd_listen_port" ]; then
33    echo "lpd_listen_port=515" >> /etc/lprng/lpd.conf
34fi
Note: See TracBrowser for help on using the repository browser.