Bug#463578: lprng: if-up script fails to invoke the init script
Package: lprng
Version: 3.8.A~rc4-3
Dear Craig,
thank you for your fast fixes of the lprng package.
Might I make another suggestion?
In the script /etc/init.d/lprng I would replace the line
LPD_PORT=$(grep "^[[:space:]]*lpd_port" $CONFIGDIR/lpd.conf | cut -d "=" -f 2)
by
LPD_PORT=$(sed '/^[[:space:]]*lpd_port/!d; s/.*[=#]\(.*\)/\1/; q' $CONFIGDIR/lpd.conf)
and, accordingly, the line
LOCKFILE=$(grep "^[[:space:]]*lockfile" $CONFIGDIR/lpd.conf | cut -d "=" -f 2)
by
LPD_PORT=$(sed '/^[[:space:]]*lockfile/!d; s/.*[=#]\(.*\)/\1/; q' $CONFIGDIR/lpd.conf)
This has three advantages:
1) The syntax as described in the manual page lpd.conf(5) is
better satisfied, as it also allows lines like
lpd_port#505
similar to the syntax of printcap files.
2) In case there is more than one matching line only the first
one is used and the result doesn't contain a newline.
3) There is no need to call two external programs and connect
them with a pipe.
--
Regards,
Jörg-Volker.
Reply to: