dkanavis

Untitled

Sep 21st, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.33 KB | None | 0 0
  1. eval {
  2.         local $SIG{ALRM} = sub { die "TIME6661313" };
  3.         alarm($SSH_TIMEOUT);
  4.         local $/ = undef;
  5.         $repl = <P>;
  6.         close P;
  7.         alarm(0);
  8.     };
  9.     if ($@) {
  10.         if ($@ eq "TIME6661313") {
  11.             die("SSH command $cmd timed out");
  12.         } else {
  13.             die($@);
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment