3 # tvheadend tvheadend tv streaming service
7 # description: tvheadend tv streaming service
9 # processname: tvheadend
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21 msg_network_down "tvheadend"
31 # Get service config - may override defaults
32 [ -f /etc/sysconfig/tvheadend ] && . /etc/sysconfig/tvheadend
35 # must return non-zero if check failed
36 # output is discarded if checkconfig is ran without details
38 /usr/sbin/tvheadend -t
42 # wrapper for configtest
46 if [ $details = 1 ]; then
47 # run config test and display report (status action)
48 show "Checking %s configuration" "tvheadend"; busy
50 out=$(configtest 2>&1)
52 if [ $RETVAL = 0 ]; then
57 [ "$out" ] && echo >&2 "$out"
59 # run config test and abort with nice message if failed
60 # (for actions checking status before action).
61 configtest >/dev/null 2>&1
63 if [ $RETVAL != 0 ]; then
64 show "Checking %s configuration" "tvheadend"; fail
65 nls 'Configuration test failed. See details with %s "checkconfig"' $0
72 # Check if the service is already running?
73 if [ -f /var/lock/subsys/tvheadend ]; then
74 msg_already_running "tvheadend"
79 msg_starting "tvheadend"
80 daemon --group video /usr/sbin/tvheadend $TVHEADEND_ARGS
82 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tvheadend
86 if [ ! -f /var/lock/subsys/tvheadend ]; then
87 msg_not_running "tvheadend"
92 msg_stopping "tvheadend"
94 rm -f /var/lock/subsys/tvheadend
98 if [ ! -f /var/lock/subsys/tvheadend ]; then
99 msg_not_running "tvheadend"
105 msg_reloading "tvheadend"
106 killproc tvheadend -HUP
111 if [ ! -f /var/lock/subsys/tvheadend ]; then
112 msg_not_running "tvheadend"
123 # See how we were called.
139 # include force-reload here if program allows reloading without restart
140 # otherwise remove reload action and support force-reload as restart if running
144 # use this one if program doesn't support reloading without restart
148 checkconfig|configtest)
156 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|checkconfig|status}"