updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / inputlircd-svn / inputlircd.init
blobba835cb57e7bbf382ad039a9fdee6a1006560ff4
1 #!/bin/bash
3 # source application-specific settings
4 INPUTLIRCD_ARGS=
5 [ -f /etc/conf.d/inputlircd ] && . /etc/conf.d/inputlircd
7 . /etc/rc.conf
8 . /etc/rc.d/functions
10 PID=`pidof -o %PPID /usr/sbin/inputlircd`
11 case "$1" in
12 start)
13 stat_busy "Starting InputLIRCd Daemon"
14 [ -z "$PID" ] && /usr/sbin/inputlircd ${INPUTLIRCD_ARGS}
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon inputlircd
19 stat_done
22 stop)
23 stat_busy "Stopping InputLIRCd Daemon"
24 [ ! -z "$PID" ] && kill $PID &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon inputlircd
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
39 esac
40 exit 0