#------------------------------------------------------------------------------ # /etc/rc.d/rc910.arping # # Creation: 2007-03-14 lanspezi # Last Update: $Id$ #------------------------------------------------------------------------------ if [ "$HTTPD_ARPING" = "yes" -o -f /var/run/do_arping ] then begin_script ARPING "check state of hosts ..." [ 0$HOSTS_N -eq 0 ] || for i in `seq 1 $HOSTS_N` do eval ipaddr='$HOST_'$i'_IP4' translate_ip_net $ipaddr HOST_${i}_IP4 ipaddr || continue ipdev=`ip route get $ipaddr | sed "s/^.*dev \([^ ]*\) .*$/\1/"` case $ipdev in tun*|lo|ppp*|ippp*) continue ;; esac if [ -n "$ipaddr" -a -n "$ipdev" ] then echo "${ipaddr} ${ipdev}" >> /var/run/arping.ip fi done # echo 100 > /proc/sys/net/ipv4/neigh/*/locktime # echo 60 > /proc/sys/net/ipv4/neigh/*/gc_stale_time if [ -f /var/run/arping.ip ] then log_info "start daemon to check online/offline state of hosts" /usr/local/bin/arping.sh & fi end_script fi