X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=arpwatch.init;h=f50694b7f3471a1adc38729b8fba3e30eef9de8f;hb=1ee5465f01609f191e6eb8decd8e5219791c37b5;hp=4477ab2969838f6078264559771835927edfbc61;hpb=75afa61b8470efe1df3de79228c322bd95f74117;p=packages%2Farpwatch.git diff --git a/arpwatch.init b/arpwatch.init index 4477ab2..f50694b 100644 --- a/arpwatch.init +++ b/arpwatch.init @@ -1,6 +1,6 @@ #!/bin/sh # -# chkconfig: 345 55 45 +# chkconfig: 345 55 45 # description: The arpwatch daemon attempts to keep track of ethernet/ip \ # address pairings. # processname: arpwatch @@ -11,12 +11,15 @@ # Get network config . /etc/sysconfig/network +# Initial values +GLOBAL_OPTIONS="" + # Get service config [ -f /etc/sysconfig/arpwatch ] && . /etc/sysconfig/arpwatch # Check that networking is up. if is_yes "${NETWORKING}"; then - if [ ! -f /var/lock/subsys/network -a != stop -a != status ]; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down "arpwatch" exit 1 fi @@ -24,6 +27,16 @@ else exit 0 fi +if is_yes "${NO_BOGON}"; then + GLOBAL_OPTIONS="$GLOBAL_OPTIONS -N" +else + if [ -n "${LOCAL_NETWORKS}" ]; then + for i in ${LOCAL_NETWORKS}; do + GLOBAL_OPTIONS="$GLOBAL_OPTIONS -n $i" + done + fi +fi + RETVAL=0 # See how we were called. case "$1" in @@ -40,7 +53,16 @@ case "$1" in msg_starting "arpwatch ($IFC)" touch /var/lib/arpwatch/$IFC.dat chown 2:2 /var/lib/arpwatch/$IFC.dat - daemon arpwatch $NETWORKS -i $IFC -f /var/lib/arpwatch/$IFC.dat -u daemon + OPTIONS="$GLOBAL_OPTIONS" + if ! is_yes "${NO_BOGON}"; then + eval IF_LOCAL_NETWORKS=\$${IFC}_LOCAL_NETWORKS + if [ -n "${IF_LOCAL_NETWORKS}" ]; then + for i in ${IF_LOCAL_NETWORKS}; do + OPTIONS="$OPTIONS -n $i" + done + fi + fi + daemon arpwatch $NETWORKS -i $IFC -f /var/lib/arpwatch/$IFC.dat -u daemon $OPTIONS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/arpwatch done @@ -55,7 +77,7 @@ case "$1" in rm -f /var/lock/subsys/arpwatch >/dev/null 2>&1 else msg_not_running "arpwatch" - fi + fi ;; status) status arpwatch