updated on Mon Jan 16 16:00:41 UTC 2012
[aur-mirror.git] / razercfg / razerd
blob3d40e2070dc218e0df27af16787a51c3c7f2d503
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 # Path to the PID-file
7 PIDFILE="/var/run/razerd/razerd.pid"
9 case "$1" in
10 start)
11 stat_busy "Starting razerd"
12 razerd -B -P $PIDFILE &> /dev/null
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon razerd
17 stat_done
20 stop)
21 stat_busy "Stopping razerd"
22 if [ -r "$PIDFILE" ]; then
23 kill `cat $PIDFILE` &> /dev/null
24 if [ $? -gt 0 ]; then
25 stat_fail
26 else
27 rm_daemon razerd
28 stat_done
30 else
31 stat_fail
34 restart)
35 $0 stop
36 sleep 1
37 $0 start
40 echo "usage: $0 {start|stop|restart}"
41 esac
42 exit 0