updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / oscam-svn / oscam.rc.d
bloba896f895338f5ba0be605fe77c19be98796b5579
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/oscam
7 PID=$(pidof -o %PPID /usr/bin/oscam)
9 case $1 in
10 start)
11 stat_busy "Starting oscam"
13 if [[ -z $PID ]] && /usr/bin/oscam $OSCAM_ARGS; then
14 add_daemon oscam
15 stat_done
16 else
17 stat_fail
18 exit 1
21 stop)
22 stat_busy "Stopping oscam"
23 if [[ ! -z $PID ]] && killall /usr/bin/oscam &> /dev/null; then
24 rm_daemon oscam
25 stat_done
26 else
27 stat_fail
28 exit 1
31 restart)
32 $0 stop
33 $0 start
36 echo "Usage: $0 {start|stop|restart}"
37 exit 1
38 esac