Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 1d30a4f3941a4dcc169b125ff8952fe9 > files > 4

tvheadend-3.2.18-2.mga3.src.rpm

#!/bin/bash
#
### BEGIN INIT INFO
# Provides: tvheadend
# Should-Start: $network
# Default-Start: 2 3 4 5
# Default-Stop: 6 0
# Short-Description: Launches the Tvheadend TV streaming server
# Description: This startup script launches the Tvheadend TV streaming server
### END INIT INFO
# chkconfig: 2345 99 01
# description: Tvheadend  is a TV streaming server for Linux
# processname: tvheadend
# pidfile: /var/run/tvheadend.pid


# Source function library.
. /etc/init.d/functions

prog="tvheadend"

start() {
	echo -n $"Starting $prog: "	
	daemon tvheadend -f -u tvheadend -g video
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/tvheadend
	return $RETVAL
}

stop() {
	echo -n $"Stopping $prog: "
	killproc tvheadend
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tvheadend
	return $RETVAL
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart|reload)
        if [ -f /var/lock/subsys/tvheadend ]; then
  	 stop
	 start
        else
         start
        fi
	;;
  status)
	status tvheadend
	;;
  condrestart)
  	[ -f /var/lock/subsys/tvheadend ] && $0 restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
	exit 1
esac