updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pytivo-wmcbrine-git / rc.d
bloba4d0a43ce303b9f91f7ef54ea355b3ce4480ecfa
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 NAME=pytivo
7 FILE=/usr/share/pyTivo/pyTivo.py
8 PID=`pgrep -f pyTivo.py`
9 DESCRIPTION=pyTivo
11 case "$1" in
12 start)
13 stat_busy "Starting $DESCRIPTION..."
14 [ -z "$PID" ] && python $FILE &> /var/log/pytivo.log &
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon $NAME
19 stat_done
22 stop)
23 stat_busy "Stopping $DESCRIPTION..."
24 [ ! -z "$PID" ] && kill -9 $PID &>/dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon $NAME
29 stat_done
32 restart|force-reload)
33 $0 stop
34 $0 start
36 esac
37 exit 0