#WAN & LAN IP settings myip () { INTERFACE=`cat /proc/net/arp | grep -m 1 -v Device | awk '{print $6}'` /usr/bin/wget -np -c www.watismijnip.nl --output-document /tmp/index.html."$$" 2>/dev/null && export PRPID="$$" WAN_IP=`grep -i 'www.WatIsMijnIP.nl' /tmp/index.html."$PRPID" | cut -d'>' -f3 | tr -d '[:blank:]' | cut -d'<' -f1` LAN_IP=`/sbin/ifconfig $INTERFACE | grep 'inet addr:' | cut -d: -f2 | cut -d' ' -f1 | tr -d '[:blank:]'` export {WAN,LAN}_IP && echo -en "\nWAN IP: $WAN_IP\n" && echo -en "LAN IP: $LAN_IP\n\n" && /bin/rm -f /tmp/index.html."$PRPID" } if ping -c 1 -w 1 www.google.be &>/dev/null; then myip; else echo -en "\nThere is currently no\nConnection to the internet\nPlease check your settings! \n\n"; fi