]>
Commit | Line | Data |
---|---|---|
cd77786f | 1 | #!/bin/sh |
7b0d0d3a AF |
2 | # |
3 | # chkconfig: - 55 45 | |
4 | # description: The arpwatch daemon attempts to keep track of ethernet/ip \ | |
5 | # address pairings. | |
6 | # processname: arpwatch | |
7 | ||
63276756 | 8 | |
9 | # Source function library | |
7b0d0d3a AF |
10 | . /etc/rc.d/init.d/functions |
11 | ||
63276756 | 12 | # Get network config |
7b0d0d3a AF |
13 | . /etc/sysconfig/network |
14 | ||
63276756 | 15 | # Get service config |
16 | [ -f /etc/sysconfig/arpwatch ] && . /etc/sysconfig/arpwatch | |
17 | ||
7b0d0d3a | 18 | # Check that networking is up. |
a454c97d | 19 | if [ "${NETWORKING}" = "no" ]; then |
20 | echo "WARNING: Networking is down. Arpwatch service can't be runed." | |
21 | exit 1 | |
22 | fi | |
63276756 | 23 | |
7b0d0d3a AF |
24 | |
25 | # See how we were called. | |
26 | case "$1" in | |
27 | start) | |
63276756 | 28 | # Check if the service is already running? |
29 | if [ ! -f /var/lock/subsys/arpwatch ]; then | |
30 | show Starting arpwatch | |
31 | daemon arpwatch | |
32 | else | |
33 | echo "arpwatch already is running" | |
34 | fi | |
7b0d0d3a AF |
35 | touch /var/lock/subsys/arpwatch |
36 | ;; | |
37 | stop) | |
63276756 | 38 | show Stopping arpwatch |
7b0d0d3a AF |
39 | killproc arpwatch |
40 | rm -f /var/lock/subsys/arpwatch | |
41 | ;; | |
42 | status) | |
43 | status arpwatch | |
44 | ;; | |
45 | restart|reload) | |
46 | $0 stop | |
47 | $0 start | |
48 | ;; | |
49 | *) | |
cd77786f | 50 | echo "Usage: $0 {start|stop|status|restart|reload}" |
7b0d0d3a AF |
51 | exit 1 |
52 | esac | |
53 | ||
54 | exit 0 |