summaryrefslogtreecommitdiffstats
path: root/generic/etc/init.d/inetd
blob: 9c746713d547ccc04edacc70fdbe38213ba6df9e (plain)
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
#!/bin/sh
# 
# This is an inetd init.d script which ist called by init(1) with [start|stop] as argument
#

PATH=/sbin:/bin:/usr/bin
BINARY=/usr/sbin/inetd

# --- nothing to change after this line ---

test -f $BINARY || { echo "$BINARY not found" >&2 ; exit 0; }

start_proc() {
	echo -n "Starting INETD server: inetd ..."
	$BINARY
	echo "DONE"
}

stop_proc() {
	echo -n "Stopping INETD server: inetd ..."
	killall inetd
	echo "DONE"
}


case "$1" in
        start)
        	start_proc
		;;
	stop)	
		stop_proc
		;;
        restart|force-reload)
                echo -n "Restarting INETD server: inetd... "
                stop_proc
		sleep 2
                start_proc
		echo "done."
                ;;
        reload)
                echo "Not supported" >&2
                exit 1
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|force-reload}"
                exit 1
                ;;
esac

exit 0