summaryrefslogtreecommitdiffstats
path: root/package/inadyn/S70inadyn
blob: b20048ce8c0d949255c07a007649c5e4c97ac5f9 (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
#!/bin/sh
#
# Start & stop the inadyn client
#

CONFIG=/etc/inadyn.conf
VR_INADYN=/var/run/inadyn

# check if CONFIG exists, print message & exit if it doesn't
[ ! -f $CONFIG ] && ( echo "The config file "$CONFIG" is missing...exiting now." && exit 2 )

# check if VR_INADYN exists, create it if not
[ ! -d $VR_INADYN ] && mkdir -p $VR_INADYN

case "$1" in
	start)
		echo "Starting inadyn: "
		start-stop-daemon -S -x /usr/bin/inadyn
		[ $? = 0 ] && echo "OK" || echo "FAIL"
		;;
	stop)
		echo  "Stopping inadyn: "
		start-stop-daemon -q -K -x /usr/bin/inadyn
		[ $? = 0 ] && echo "OK" || echo "FAIL"
		rm -f /var/run/inadyn/inadyn.pid
		;;
	restart)
		"$0" stop
		"$0" start
		;;
		*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1
esac

exit $?
OpenPOWER on IntegriCloud