#!/bin/sh WLAN_CONFIG=/home/tool/config/wlan.json CONSTATE=/var/run/diag/tiwlan/constatus cat $WLAN_CONFIG | grep '"interface": true' > /dev/null 2>&1 if [ "$?" -eq "0" ]; then cat $WLAN_CONFIG | grep '"garp": true' > /dev/null 2>&1 if [ "$?" -eq "0" ]; then cat $CONSTATE | grep '3' > /dev/null 2>&1 if [ "$?" -eq "0" ]; then GATEWAY=`route -n | grep "^0.0.0.0" | tr -s " " | grep tiwlan0 | cut -f2 -d" "` arping -f -c 2 -w 2 -I tiwlan0 $GATEWAY logger -t arping.sh "ARP Request GW <$GATEWAY>" fi fi fi