diff options
Diffstat (limited to 'recipes-core/multitech/reset-handler/reset-handler.init')
-rw-r--r-- | recipes-core/multitech/reset-handler/reset-handler.init | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/recipes-core/multitech/reset-handler/reset-handler.init b/recipes-core/multitech/reset-handler/reset-handler.init new file mode 100644 index 0000000..b50e7b8 --- /dev/null +++ b/recipes-core/multitech/reset-handler/reset-handler.init @@ -0,0 +1,30 @@ +#!/bin/sh + +DAEMON=/usr/sbin/reset-handler +PIDFILE=/var/run/reset-handler.pid +ENABLED="yes" + +[ -r /etc/default/reset-handler ] && . /etc/default/reset-handler +[ -x $DAEMON ] || exit 0 +[ "$ENABLED" = "yes" ] || exit 0 + +case "$1" in + start) + if [ -f $PIDFILE ]; then + echo "reset-handler pid file exists, not starting" + exit 1 + else + echo "Starting reset-handler" + start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON + fi + ;; + stop) + echo "Stopping reset-handler" + start-stop-daemon --stop --oknodo --pidfile $PIDFILE + rm -f $PIDFILE + ;; + *) + echo "Usage: $0 {start|stop}" + exit 2 + ;; +esac |