0
|
1 #! /bin/sh
|
|
2 #
|
|
3 # chkconfig: - 55 45
|
|
4 # description: The arpwatch daemon attempts to keep track of ethernet/ip \
|
|
5 # address pairings.
|
|
6 # processname: arpwatch
|
|
7
|
|
8 # Source function library.
|
|
9 . /etc/rc.d/init.d/functions
|
|
10
|
|
11 # Get config.
|
|
12 . /etc/sysconfig/network
|
|
13
|
|
14 if [ -f /etc/sysconfig/arpwatch ];then
|
|
15 . /etc/sysconfig/arpwatch
|
|
16 fi
|
|
17
|
|
18 # Check that networking is up.
|
|
19 if [ "$NETWORKING" = "no" ]
|
|
20 then
|
|
21 exit 0
|
|
22 fi
|
|
23
|
|
24 RETVAL=0
|
|
25 prog="arpwatch"
|
|
26
|
|
27 start () {
|
|
28 echo -n $"Starting $prog: "
|
|
29 daemon arpwatch $OPTIONS
|
|
30 RETVAL=$?
|
|
31 echo
|
|
32 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/arpwatch
|
|
33 }
|
|
34 stop () {
|
|
35 echo -n $"Stopping $prog: "
|
|
36 killproc arpwatch
|
|
37 RETVAL=$?
|
|
38 echo
|
|
39 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/arpwatch
|
|
40 }
|
|
41
|
|
42 restart () {
|
|
43 stop
|
|
44 start
|
|
45 }
|
|
46
|
|
47
|
|
48 # See how we were called.
|
|
49 case "$1" in
|
|
50 start)
|
|
51 start
|
|
52 ;;
|
|
53 stop)
|
|
54 stop
|
|
55 ;;
|
|
56 status)
|
|
57 status arpwatch
|
|
58 ;;
|
|
59 restart|reload)
|
|
60 restart
|
|
61 ;;
|
|
62 condrestart)
|
|
63 [ -f /var/lock/subsys/arpwatch ] && restart || :
|
|
64 ;;
|
|
65 *)
|
|
66 echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
|
67 exit 1
|
|
68 esac
|
|
69
|
|
70 exit $?
|