File: init.d

package info (click to toggle)
bayonne 2.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 11,180 kB
  • ctags: 3,662
  • sloc: cpp: 38,791; sh: 9,323; ansic: 1,391; makefile: 485; perl: 471; java: 405; cs: 402; php: 354; python: 293
file content (63 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download
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
#! /bin/sh
#
### BEGIN INIT INFO
# Provides:          bayonne
# Required-Start:    $all
# Required-Stop:     $all
# Should-Start:      $local_fs
# Should-Stop:       $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: GNU Telephony Server
# Description:       Bayonne GNU Telephony Server
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/bayonne
NAME=bayonne
DESC='GNU Telephony Server'
ARGS='' 

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
	test -e /etc/bayonne/bayonne.conf && echo "Cleanup: ** Please remove obsolete /etc/bayonne.conf"
	test -e /etc/bayonne/bayonne.sched && echo "Cleanup: ** Please remove obsolete /etc/bayonne.sched"
	test -e /home/bayonne && echo "Cleanup: ** Please remove obsolete /home/bayonne/"
	test -e /var/bayonne && echo "Cleanup: ** Please remove obsolete /var/bayonne/"

	echo -n "Starting $DESC: "
	start-stop-daemon --start -v --exec $DAEMON -- $ARGS
	echo "$NAME."
	;;
  stop)
	echo -n "Stopping $DESC: "
	 $DAEMON --stop
	#start-stop-daemon --stop -u $NAME \
	# --oknodo --stop --quiet \
	echo "$NAME."
	;;
  restart|force-reload)
	#
	#	If the "reload" option is implemented, move the "force-reload"
	#	option to the "reload" entry above. If not, "force-reload" is
	#	just the same as "restart".
	#
	echo -n "Restarting $DESC: "
	$0 stop 
	sleep 5
	$0 start
	echo "$NAME."
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0