Statistics
| Branch: | Tag: | Revision:

dvbd / debian / dvbd.init @ e34a9e8b

History | View | Annotate | Download (1.76 KB)

1
#! /bin/sh
2
#
3
# dvbd  	Startup script
4
#		This file should be used to construct scripts for /etc/init.d.
5
#
6
#		Adapted from Miquel van Smoorenburg <miquels@cistron.nl>.
7
#		Modified for Debian 
8
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
9
#
10

    
11
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
12
DAEMON=/usr/sbin/dvbd
13
NAME=dvbd
14
DESC=dvbd
15

    
16
test -x $DAEMON || exit 0
17

    
18
# Include dvbd defaults if available
19
if [ -f /etc/default/dvbd ] ; then
20
	. /etc/default/dvbd
21
fi
22

    
23
set -e
24

    
25
case "$1" in
26
  start)
27
	echo -n "Starting $DESC: "
28
	start-stop-daemon --chuid=dvbd  --start --quiet --exec $DAEMON -- $DAEMON_OPTS
29
	echo "$NAME."
30
	;;
31
  stop)
32
	echo -n "Stopping $DESC: "
33
	start-stop-daemon --chuid=dvbd --stop --quiet --pidfile /var/run/dvbd/$NAME.pid \
34
		--exec $DAEMON || true
35
	echo "$NAME."
36
	;;
37
  #reload)
38
	#
39
	#	If the daemon can reload its config files on the fly
40
	#	for example by sending it SIGHUP, do it here.
41
	#
42
	#	If the daemon responds to changes in its config file
43
	#	directly anyway, make this a do-nothing entry.
44
	#
45
	# echo "Reloading $DESC configuration files."
46
	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
47
	#	/var/run/dvbd/$NAME.pid --exec $DAEMON
48
  #;;
49
  restart|force-reload)
50
	#
51
	#	If the "reload" option is implemented, move the "force-reload"
52
	#	option to the "reload" entry above. If not, "force-reload" is
53
	#	just the same as "restart".
54
	#
55
	echo -n "Restarting $DESC: "
56
	start-stop-daemon --chuid=dvbd --stop --quiet --pidfile \
57
		/var/run/dvbd/$NAME.pid --exec $DAEMON
58
	sleep 1
59
	start-stop-daemon --chuid=dvbd --start --quiet \
60
		/var/run/dvbd/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
61
	echo "$NAME."
62
	;;
63
  *)
64
	N=/etc/init.d/$NAME
65
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
66
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
67
	exit 1
68
	;;
69
esac
70

    
71
exit 0