#!perl # # Script to log onto the ADSL route and print out the # # # # If you are getting Interal server error messages, # use the code below to pipe script errors to the browser use CGI::Carp ( fatalsToBrowser); use IO::Socket; &setDate(); my $sock = IO::Socket::INET->new(PeerAddr => '192.168.7.1', PeerPort => 23, Proto => 'tcp', Timeout => 5000 ); $opFileName ="adsl.log"; open ( OP ,">>$opFileName") || &file_error( OP , $opFileName ); # Print Beginning of HTML print "Content-Type: text/html\n\n"; print "
\n" ; print "==================================\n"; print $date ."\n"; print "==================================\n"; print( "fileno: STDIN = ".fileno( "STDIN" )."\n"); print( "fileno: STDOUT = ".fileno( "STDOUT" )."\n"); print( "fileno: STDERR = ".fileno("STDERR")."\n"); print( "fileno: SOCK = ".fileno($sock)."\n"); print( "fileno: OP = ".fileno(OP)."\n"); print "==================================\n"; my $bitArray = 0; vec( $bitArray,2,1 ); print( "bitArray: ".$bitArray ."\n"); print "==================================\n"; # # if connect failed, end script # if ( $sock ) { print ( "Connected .. attempting to log on..\n"); } else { print ( "failed to Connect to ADSL router
\n"); print ''; if ( defined OP ) { print OP "==================================\n"; print OP $date ."\n"; print OP "failed to Connect to ADSL router \n"; print OP "==================================\n"; close( OP ); } exit; } # # if connect failed, end script # if ( $sock->connected ) { print ( "Connected .. attempting to log on..\n"); } else { print ( "failed to Connect to ADSL router
\n"); print '