#!/usr/bin/perl -w

#print "getip address\n";




$ret = `wget --http-user=speedtouch --http-pass=apfst2004 http://192.168.0.254/cgi/status/no_wizard -O - 2>/dev/null`;

#print $ret;
system("/bin/touch", "/tmp/getip2");

#$ret =~ /([0-9]+\.[0-9]+\[0-9]+\.[0-9])\/32/ ;

#my($myip) = $1;

#print "$myip";

@webpage = split("\n", $ret) ;

foreach(@webpage){

my ($myline) = "$_";

if ($myline =~ /([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\/32/ ){

#if ($myline =~ /(\/32)/ ){
$myip = "$1" ;

print "$myip\n";
}

};





#get external ip address



#wget http://192.168.0.254/cgi/status/no_wizard -O $TMP_FILE

# cat /tmp/external_ip.txt | grep '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'


