-
Notifications
You must be signed in to change notification settings - Fork 2
/
wanfaild.init
executable file
·85 lines (75 loc) · 1.62 KB
/
wanfaild.init
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
#
# wanfaild: Monitor WAN links and provide failover
#
# chkconfig: - 98 02
# description: wanfaild will monitor one or more WAN links
# and provide failover support.
#
# processname: wanfaild
# pidfile: /var/run/wanfaild.pid
#
### BEGIN INIT INFO
# Provides: wanfaild
# Required-Start: $network
# Should-Start: $syslog $named $time
# Required-Stop $network
# Should-Stop: $syslog $named $time
# Short-Description: Monitor WAN links and provide failover
# Description: wanfaild will monitor one or more WAN links
# and provide failover support.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
SERVICE=wanfaild
PROCESS=wanfaild
RETVAL=0
start() {
echo -n $"Starting $SERVICE daemon: "
daemon $PROCESS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
}
stop() {
echo -n $"Stopping $SERVICE daemon: "
killproc $PROCESS
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/$SERVICE
rm -f /var/run/$SERVICE.pid
fi
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading $SERVICE configuration: "
killproc $PROCESS -HUP
RETVAL=$?
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start|stop|restart|reload)
$1
;;
status)
status $PROCESS
RETVAL=$?
;;
force-reload)
reload
;;
condrestart|try-restart)
[ -f /var/lock/subsys/$SERVICE ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
exit 1
;;
esac
exit $RETVAL