use Net::OpenSSH; my $ssh = Net::OpenSSH->new('root@192.168.123.5'); $ssh->error and die "unable to connect to remote host: ". $ssh->error; my $fh = $ssh->pipe_out("/sbin/service", "syslog", "restart") or die "command failed: " . $ssh->error; print while <$fh>; close $fh or die "command failed: $?";
In reply to Re: Net::SSH2 Command Timeout Before Completion
by salva
in thread Net::SSH2 Command Timeout Before Completion
by taim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |