updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / spacenavd / spacenavd
blob61946197c40b4e6b0125924439607275b7582f8b
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=/usr/bin/spacenavd
8 PID=`pidof -o %PPID $DAEMON`
9 case "$1" in
10 start)
11 stat_busy "Starting Spacenavigator Daemon"
12 [ -z "$PID" ] && $DAEMON
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon spacenavd
17 stat_done
20 stop)
21 stat_busy "Stopping Spacenavigator Daemon"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon spacenavd
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0