perldesire has asked for the wisdom of the Perl Monks concerning the following question:
I have two things to be done.
2.loadcert.plmy $prompt = '/\/\.\/->/'; my $con = new Net::Telnet(Timeout => 400, Prompt => $prompt); $con->open("192.168.1.1"); $con->login("admin", "password"); my $prompt = '/\/\.\/map1\/firmware\/->/'; my @lines = $con->cmd(String => "cd /map1/firmware", Prompt => $prompt +); my $load_firmware = "load -source //14.0.1.0/test.bin -oemhpfiletype c +sr"; @lines = $con->cmd(String => $load_firmware, Prompt => $prompt); print join "\n",@lines; @lines = $con->cmd(String => 'reset', Prompt => '/Map1 reset\./'); $con->close();
3. Mainexecution.plmy $prompt = '/\/\.\/->/'; my $con = new Net::Telnet(Timeout => 400, Prompt => $prompt); $con->open("192.168.1.1"); $con->login("admin", "password"); my $prompt = '/\/\.\/map1\/firmware\/->/'; my @lines = $con->cmd(String => "cd /map1/firmware", Prompt => $prompt +); my $load_firmware = "load -source //14.0.1.0/cert.pem -oemhpfiletype c +sr"; @lines = $con->cmd(String => $load_firmware, Prompt => $prompt); print join "\n",@lines; @lines = $con->cmd(String => 'reset', Prompt => '/Map1 reset\./'); $con->close();
my $cmd = "perl firmwareupdate.pl" if ( system($cmd) == 0 ) { print "sucess\n"; } else { print "Failed\n"; } $cmd = "perl loadcert.pl" if ( system($cmd) == 0 ) { print "sucess\n"; } else { print "Failed\n"; }
When executing Mainexecution.pl always first called script alone is getting success. If i call loadcert.pl first its getting success, when executing next script its stopped with the error "Download Unsuccessful". What could be the issues? I checked the closing part of the first called script, its returning success i.e closing perfectly.
If any body has knowledge on this, kindly give your ideas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net:::Telnet - two consecutive connection
by Illuminatus (Curate) on Sep 29, 2009 at 14:46 UTC | |
by perldesire (Scribe) on Sep 30, 2009 at 09:02 UTC | |
|
Re: Net:::Telnet - two consecutive connection
by lothos (Novice) on Sep 29, 2009 at 15:01 UTC | |
|
Re: Net:::Telnet - two consecutive connection
by Anonymous Monk on Sep 29, 2009 at 14:26 UTC |