#! /bin/sh # postinst script for plptools # # see: dh_installdeb(1) set -e . /usr/share/debconf/confmodule # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) START_NCPD=no START_PLPFUSE=no START_PLPPRINTD=no NCPD_ARGS= PLPFUSE_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/plpfuse/start if [ "$RET" = "true" ] ; then START_PLPFUSE=yes PLPFUSE_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 -c 'lpr -P$RET'" fi fi # Strip leading whitespace from argument lists NCPD_ARGS=${NCPD_ARGS## } PLPFUSE_ARGS=${PLPFUSE_ARGS## } PLPPRINTD_ARGS=${PLPPRINTD_ARGS## } # Move /etc/plptools.conf to /etc/default/plptools if it exists if test -f /etc/plptools.conf; then mv /etc/plptools.conf /etc/default/plptools fi cp /etc/default/plptools /etc/default/plptools.$$ cat /etc/default/plptools.$$ | sed \ -e "s@START_NCPD=.*@START_NCPD=$START_NCPD@" \ -e "s@START_PLPFUSE=.*@START_PLPFUSE=$START_PLPFUSE@" \ -e "s@START_PLPPRINTD=.*@START_PLPPRINTD=$START_PLPPRINTD@" \ -e "s@NCPD_ARGS=.*@NCPD_ARGS=\"$NCPD_ARGS\"@" \ -e "s@PLPFUSE_ARGS=.*@PLPFUSE_ARGS=\"$PLPFUSE_ARGS\"@" \ -e "s@PLPPRINTD_ARGS=.*@PLPPRINTD_ARGS=\"$PLPPRINTD_ARGS\"@" \ > /etc/default/plptools \ && rm -f /etc/default/plptools.$$ \ || mv /etc/default/plptools.$$ /etc/default/plptools || : ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# db_stop exit 0