Initial commit of `icmpmonitor-1.2` from http://www.crocodile.org/software.html
[icmpmonitor] / icmpmonitor.init
CommitLineData
c5de9e27
AT
1#! /bin/sh
2#
3# chkconfig: - 60 20
4# description: check is some hosts are alive
5# processname: icmpmonitor
6
7# Get config.
8. /etc/sysconfig/network
9
10# Get functions
11. /etc/rc.d/init.d/functions
12
13# Check that networking is up.
14if [ ${NETWORKING} = "no" ] ; then
15 exit 0
16fi
17
18[ -f /usr/local/sbin/icmpmonitor ] || exit 0
19[ -f /usr/local/etc/icmpmonitor.cfg ] || exit 0
20
21RETVAL=0
22
23# See how we were called.
24case "$1" in
25 start)
26 echo -n "Starting icmpmonitor: "
27 daemon /usr/local/sbin/icmpmonitor -d -f /usr/local/etc/icmpmonitor.cfg
28 RETVAL=$?
29 echo
30 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/icmpmonitor
31 ;;
32 stop)
33 echo -n "Stopping icmpmonitor: "
34 killproc icmpmonitor
35 RETVAL=$?
36 echo
37 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icmpmonitor
38 ;;
39 status)
40 status icmpmonitor
41 RETVAL=$?
42 ;;
43 restart)
44 $0 stop
45 $0 start
46 RETVAL=$?
47 ;;
48 *)
49 echo "Usage: $0 {start|stop|status|restart}"
50 exit 1
51 ;;
52esac
53
54exit $RETVAL