james_culling has asked for the wisdom of the Perl Monks concerning the following question:
my $host = "X.X.X.X"; my $usr = "root"; my $pas = "root"; my $ssh1 = Net::SSH::Expect->new ( host => $host, password=> $pas, user => $usr, raw_pty => 1, timeout => 20 ); my $login_output = $ssh1->login(); if ($login_output !~ /#/) { print "Debug: login failed "; $ssh1->close(); } else { $ssh1->cmd("/system/reboot force"); $ssh1->close(); return 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: net-ssh-expect is giving error
by salva (Canon) on Jan 16, 2014 at 12:20 UTC | |
|
Re: net-ssh-expect is giving error
by atcroft (Abbot) on Jan 16, 2014 at 15:17 UTC | |
by robby_dobby (Hermit) on Jan 17, 2014 at 05:29 UTC | |
by james_culling (Novice) on Jan 17, 2014 at 07:42 UTC | |
by james_culling (Novice) on Jan 17, 2014 at 07:59 UTC | |
by marto (Cardinal) on Jan 17, 2014 at 08:23 UTC | |
|