-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find a way to prevent Net::SSH::Perl from exiting the script if the detination port has no service. #20
Comments
You can do:
|
Thanks for the trick ! I didn't realize that eval can be used to prevent a script from exiting when a routine exits. After you wrote it, it became clear to me that it works. |
I think the newer |
I've forked this project at briandfoy/net-ssh-perl, and you can reopen this issue there if you'd like. Otherwise, I'll add it myself at some later time. See #22. If you include text like But, I think this issue has been resolved and you can close it. |
Thanks, the eval method worked for me as desired. |
Hi, thanks for this well working module, it does a great job.
Unfortunately I could not find a way to prevent the script exiting when the destination port is not under service:
If the port is reachable all works fine.
my $remoteport="3302";
my $ssh = Net::SSH::Perl->new($ConfigP::remotehost,options => ["Port $remoteport"]);
^^^^^^^^ exits after the line above, if the port does not provide a service ^^^^^^^^
$ssh->login($ConfigP::remoteuser,$ConfigP::remotepass);
my($stdout, $stderr, $exit) = $ssh->cmd("")
Is there a method in the module to check for a port under service instead of exiting ?
Regards Rolf
The text was updated successfully, but these errors were encountered: