LOG_FILE="/tmp/fiicore_wanip.log"

#clear the stats file
if [ -e $LOG_FILE ]; then
   #echo "clear the stats file"
   > $LOG_FILE
fi

wanipv4=$(ifconfig $1 | awk '/inet addr/ {gsub("addr:", "", $2); print $2}')
[ -z "$wanipv4" ] && wanipv4="NA"
echo wanipv4=$wanipv4 >> $LOG_FILE
wanipv46=$(ifconfig $1 | awk '/inet6/{print $3}')
[ -z "$wanipv6" ] && wanipv6="NA"
echo wanipv6=$wanipv6 >> $LOG_FILE
#publicipv4=$(wget -T 1  -qO- "http://api.ipify.org")
#publicipv4=$(wget -T 1  -qO- "http://whatismyip.akamai.com/")
#[ -z "$publicipv4" ] && publicipv4="NA"
#echo publicipv4=$publicipv4 >> $LOG_FILE
