diff options
author | Knut Auvor Grythe <knut@auvor.no> | 2015-03-31 16:04:44 +0200 |
---|---|---|
committer | Knut Auvor Grythe <knut@auvor.no> | 2015-03-31 16:04:44 +0200 |
commit | 69747efcf8aca1a3c1241eb126bf0d0e27b8af05 (patch) | |
tree | e7a86213e402f9f6a4e42584b17104e6b5e418b0 /clients | |
parent | aef116e3b3644f2b86b8c34150bb19fe5afe669f (diff) |
clean up juniper-ssh code
Diffstat (limited to 'clients')
-rwxr-xr-x | clients/smanagrun.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clients/smanagrun.pl b/clients/smanagrun.pl index 9f8efab..a68edf8 100755 --- a/clients/smanagrun.pl +++ b/clients/smanagrun.pl @@ -91,9 +91,8 @@ while (1) { mylog("Connecting to $switch->{sysname} on $switch->{addr}"); eval { - #my $conn = switch_connect($switch->{addr}); - my $telnet = switch_connect_ssh($switch->{addr}); - my $conn = $telnet->{telnet}; + my $ssh = switch_connect_ssh($switch->{addr}); + my $conn = $ssh->{telnet}; if (!defined($conn)) { mylog("Could not connect to ".$switch->{sysname}."(".$switch->{addr}.")"); $sdelay->execute("Could not connect to switch, delaying...", $switch->{sysname}); @@ -125,8 +124,9 @@ while (1) { $sresult->execute($result, $row->{id}); } $conn->close(); - waitpid($telnet->{pid}, 0); + waitpid($ssh->{pid}, 0); $sunlock->execute($switch->{sysname}); - } + }; + warn $@ if $@; } |