Skip to content

Could not find a way to prevent Net::SSH::Perl from exiting the script if the detination port has no service. #20

Closed
@medeiros1

Description

@medeiros1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions