updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / xbmc-eventclients-wiiremote / xbmc-wiiremote
blob1cb2ba6ddeba233bbc44ccc82df2b23db1ae0ec3
1 #!/bin/bash
3 . /etc/rc.d/functions
5 bin=/usr/bin/xbmc-wiiremote
6 PID=`pidof -o %PPID $bin`
8 case "$1" in
9 start)
10 stat_busy "Starting wiiremote eventclient"
11 [ -z "$PID" ] && $bin &> /dev/null &
12 if [[ $? -gt 0 ]]; then
13 stat_fail
14 else
15 add_daemon xbmc-wiiremote
16 stat_done
19 stop)
20 stat_busy "Stoppping wiiremote eventclient"
21 [ ! -z "$PID" ] && kill $PID &> /dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm_daemon xbmc-wiiremote
26 stat_done
29 restart)
30 $0 stop
31 while [ ! -z "$PID" -a -d "/proc/$PID" ]; do sleep 1; done
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
38 # vim: set ts=2 noet: