Z
ZoloftGuy
I'm a newbie to Perl and I am writing a script to telnet in an shut
off one of our Nortel Contivity VPNs. It works but, I'd like some of
the activity to display on the screen rather then just in the logs.
Is there anyway to do this? Here is the script. Please tell me if
there is anything back-asswords about it. Thanks:
$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');
# Contivity
system "cls"; #This clears the screen.
print "Ok, First, lets shut down the Contivities\n";
$t->open("contivity");
$t->waitfor('/Login:/');
$t->print("admin");
$t->waitfor('/Password:/');
$t->print("pass");
$t->waitfor('/CES\>/');
$t->print("en");
$t->waitfor('/Password:/');
$t->print("pass");
$t->print("shutdown -h");
$t->errmode(sub {die @_ unless $_[0] =~ /eof/});
@output1 = $t->cmd('y');
print @output1;
$t->close;
off one of our Nortel Contivity VPNs. It works but, I'd like some of
the activity to display on the screen rather then just in the logs.
Is there anyway to do this? Here is the script. Please tell me if
there is anything back-asswords about it. Thanks:
$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');
# Contivity
system "cls"; #This clears the screen.
print "Ok, First, lets shut down the Contivities\n";
$t->open("contivity");
$t->waitfor('/Login:/');
$t->print("admin");
$t->waitfor('/Password:/');
$t->print("pass");
$t->waitfor('/CES\>/');
$t->print("en");
$t->waitfor('/Password:/');
$t->print("pass");
$t->print("shutdown -h");
$t->errmode(sub {die @_ unless $_[0] =~ /eof/});
@output1 = $t->cmd('y');
print @output1;
$t->close;