source: debian/inst/edit-lpd.conf @ 1bdadfb

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

debuild runs without any lintian errors.

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/sh
2
3# add the printcap path to lpd.conf
4if [ -e /etc/lprng/lpd.conf ]; then
5    mv /etc/lprng/lpd.conf /etc/lprng/lpd.conf.bak
6    touch /etc/lprng/lpd.conf   
7
8    while read line; do
9        printcap=$(echo "$line" | grep ^printcap_path=)
10        if [ -n "$printcap" ]; then
11            lprngprintcap=$(echo "$line" | grep /etc/lprng/printcap)
12            printcap=$(echo "$line" | grep /etc/printcap)
13            if [ ! -n "$lprngprintcap" ] && [ ! -n "$printcap" ]; then
14                echo "Found line, missing correct entry, adding it..."
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)
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.