-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyTivo.init
executable file
·74 lines (62 loc) · 1 KB
/
pyTivo.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#! /bin/sh
#
# pyTivo This starts and stops the pyTivo video server.
#
# chkconfig: - 99 1
# description: This starts and stops the pyTivo video server
#
# processname: /opt/pyTivo/pyTivoDaemon.py
#
SCRIPT="/opt/pyTivo/pyTivoDaemon.py"
# Source function library.
. /etc/rc.d/init.d/functions
# Set defaults
EXTRAOPTS=
# Check that networking is up.
if [ "${NETWORKING}" = "no" ]
then
exit 0
fi
start(){
echo -n "Starting pyTivo: "
$SCRIPT start
RETVAL=$?
echo
touch /var/lock/subsys/pyTivo
}
stop(){
echo -n "Stopping pyTivo: "
$SCRIPT stop
RETVAL=$?
echo
rm -f /var/lock/subsys/pyTivo
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/tux ] && restart
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status /usr/sbin/tux
;;
restart|reload)
restart
;;
condrestart)
condrestart
;;
*)
echo "Usage: pyTivo {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL