123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/bin/sh
- ### BEGIN INIT INFO
- # Provides: razerd
- # Required-Start: $local_fs
- # Required-Stop: $local_fs
- # Default-Start: S 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: razerd daemon
- # Description: Razer device state daemon
- ### END INIT INFO
- # Path to the PID-file
- PIDFILE="/var/run/razerd/razerd.pid"
- export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
- case "$1" in
- start)
- if razerd -f -B -P "$PIDFILE"; then
- echo "Service razerd started."
- else
- echo "Failed to start razerd."
- fi
- ;;
- stop)
- if [ -r "$PIDFILE" ]; then
- kill `cat $PIDFILE`
- echo "Service razerd stopped."
- else
- echo "Service razerd is not running."
- fi
- ;;
- restart|reload|force-reload)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "Usage $0 [start|stop|restart|reload|force-reload]"
- exit 1
- ;;
- esac
- exit 0
|