#!/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