#! /bin/sh ### BEGIN INIT INFO # Provides: plptools # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start or stop the plptools daemons # Description: Enable EPOC communication, file system and printing services ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin NCPD=/usr/sbin/ncpd PLPFUSE=/usr/sbin/plpfuse PLPPRINTD=/usr/sbin/plpprintd NAME=plptools DESC=plptools CONFIG=/etc/default/plptools MOUNTPOINT=/var/lib/plptools/mnt test -x $NCPD || exit 0 test -x $PLPFUSE || exit 0 test -x $PLPPRINTD || exit 0 test -f $CONFIG && . $CONFIG || exit 0 . /lib/lsb/init-functions set -e case "$1" in start) if test "$START_NCPD" = "yes" ; then echo -n "Starting $DESC ($NCPD): " start-stop-daemon --start --quiet \ --exec $NCPD -- $NCPD_ARGS && \ echo -n "done" || echo -n "failed" echo "." sleep 1 fi if test "$START_PLPFUSE" = "yes" ; then echo -n "Starting $DESC ($PLPFUSE): " start-stop-daemon --start --quiet \ --exec $PLPFUSE -- $PLPFUSE_ARGS $MOUNTPOINT && \ echo -n "done" || echo -n "failed" echo "." fi if test "$START_PLPPRINTD" = "yes" ; then echo -n "Starting $DESC ($PLPPRINTD): " start-stop-daemon --start --quiet \ --exec $PLPPRINTD -- $PLPPRINTD_ARGS && \ echo -n "done" || echo -n "failed" echo "." fi ;; stop) if test "$START_PLPFUSE" = "yes" ; then echo -n "Stopping $DESC ($PLPFUSE): " if [ "$(uname)" = Linux ]; then fusermount -z -u $MOUNTPOINT || true elif [ "$(uname)" = GNU/kFreeBSD ]; then umount $MOUNTPOINT || true else echo "Port me" >&2 exit 1 fi start-stop-daemon --stop --retry HUP/5/TERM/1 --quiet \ --exec $PLPFUSE && \ echo -n "done" || echo -n "already stopped" echo "." fi if test "$START_PLPPRINTD" = "yes" ; then echo -n "Stopping $DESC ($PLPPRINTD): " start-stop-daemon --stop --quiet --exec $PLPPRINTD && \ echo -n "done" || echo -n "already stopped" echo "." fi if test "$START_NCPD" = "yes" ; then echo -n "Stopping $DESC ($NCPD): " start-stop-daemon --stop --quiet --exec $NCPD && \ echo -n "done" || echo -n "already stopped" echo "." fi ;; reload) ;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # $0 stop sleep 1 $0 start ;; status) if "$START_NCPD" = "yes" ; then status_of_proc "$NCPD" ncpd || exit $? fi if "$START_PLPFUSE" = "yes" ; then status_of_proc "$PLPFUSE" plpfuse || exit $? fi if "$START_PLPPRINTD" = "yes" ; then status_of_proc "$PLPPRINTD" plpprintd || exit $? fi exit 0 ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0