diff options
Diffstat (limited to 'debian/plptools.postinst')
-rw-r--r-- | debian/plptools.postinst | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/debian/plptools.postinst b/debian/plptools.postinst index 6b5db45..97c6825 100644 --- a/debian/plptools.postinst +++ b/debian/plptools.postinst @@ -25,6 +25,73 @@ set -e case "$1" in configure) + START_NCPD=no + START_PLPNFSD=no + START_PLPPRINTD=no + NCPD_ARGS= + PLPNFSD_ARGS= + PLPPRINTD_ARGS= + FREM= + db_get plptools/ncpd/start + if [ "$RET" = "true" ] ; then + START_NCPD=yes + db_get plptools/ncpd/serial + if [ "$RET" != "/dev/ttyS0" ] ; then + NCPD_ARGS="$NCPD_ARGS -s $RET" + fi + db_get plptools/ncpd/listenat + case "$RET" in + 127.0.0.1) + ;; + 127.0.0.1:7501) + ;; + *) + NCPD_ARGS="$NCPD_ARGS -p $RET" + ;; + esac + else + db_get plptools/frontends/remoteaddr + case "$RET" in + 127.0.0.1) + ;; + 127.0.0.1:7501) + ;; + *) + FREM="-p $RET" + ;; + esac + fi + db_get plptools/plpnfsd/start + if [ "$RET" = "true" ] ; then + START_PLPNFSD=yes + PLPNFSD_ARGS="$FREM" + fi + db_get plptools/plpprintd/start + if [ "$RET" = "true" ] ; then + START_PLPPRINTD=yes + PLPPRINTD_ARGS="$FREM" + db_get plptools/plpprintd/printqueue + if [ "$RET" != "psion" ] ; then + PLPPRINTD_ARGS="$PLPPRINTD_ARGS -s \"lpr -P$RET\"" + fi + fi + cp /etc/plptools.conf /etc/plptools.conf.$$ + cat /etc/plptools.conf.$$ | sed \ + -e "s@START_NCPD=.*@START_NCPD=$START_NCPD@" \ + -e "s@START_PLPNFSD=.*@START_PLPNFSD=$START_PLPNFSD@" \ + -e "s@START_PLPPRINTD=.*@START_PLPPRINTD=$START_PLPPRINTD@" \ + -e "s@NCPD_ARGS=.*@NCPD_ARGS=\"$NCPD_ARGS\"@" \ + -e "s@PLPNFSD_ARGS=.*@PLPNFSD_ARGS=\"$PLPNFSD_ARGS\"@" \ + -e "s@PLPPRINTD_ARGS=.*@PLPPRINTD_ARGS=\"$PLPPRINTD_ARGS\"@" \ + > /etc/plptools.conf \ + && rm -f /etc/plptools.conf.$$ \ + || mv /etc/plptools.conf.$$ /etc/plptools.conf || : + db_get plptools/plpnfsd/suid + if [ "$RET" = "true" ] ; then + chmod u+s /usr/sbin/plpnfsd + else + chmod u-s /usr/sbin/plpnfsd + fi ;; abort-upgrade|abort-remove|abort-deconfigure) |