summaryrefslogtreecommitdiffstats
path: root/razerd.initscript
blob: 0a138934f6722d3c2920674aac723e6540c67894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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
bues.ch cgit interface