#! /bin/sh # # accel-rotate # # description: this script starts accel-rotate daemon # processname: accel-rotate PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin NAME=accel-rotate CMD=`which accel-rotate` [ -f /etc/default/rcS ] && . /etc/default/rcS case "$1" in start) echo -n "Starting accel-rotate daemon: " start-stop-daemon --start --pidfile /var/run/${NAME}.pid --make-pidfile --background -x ${CMD} if [ $? = 0 ]; then echo "(ok)" else echo "(failed)" fi ;; stop) echo -n "Stopping accel-rotate daemon: " start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo rm -f /var/run/${NAME}.pid echo "(done)" ;; switch) echo "Switching state of accel-rotate daemon: " if [ -e "/var/run/${NAME}.pid" ]; then /etc/init.d/accel-rotate stop else /etc/init.d/accel-rotate start fi ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart|switch|force-reload}" exit 1 ;; esac exit 0