Browse files

check openssh verson >= 4.1

  • Loading branch information...
1 parent aaff5ca commit a9431df3e4649df3b89469d0e0e7c89db29d3b32 @liseen liseen committed Aug 26, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 bin/atnodes
View
17 bin/atnodes
@@ -10,8 +10,10 @@ use Term::ReadKey;
use SSH::Batch::ForNodes;
use File::Temp qw/ :POSIX /;
use Time::HiRes qw/sleep/;
+use IPC::Open3;
sub help ($);
+sub check_openssh_version ($);
if (!@ARGV) {
warn "No argument specified.\n\n";
@@ -93,6 +95,8 @@ if ($verbose) {
}
}
+check_openssh_version($ssh_cmd || 'ssh');
+
if ($use_tty) {
$concurrency = 1;
}
@@ -310,6 +314,19 @@ _EOC_
exit($exit_code);
}
}
+
+sub check_openssh_version ($) {
+ my $ssh_cmd = shift;
+
+ my $version_info = `$ssh_cmd -V 2>&1`;
+ if ($version_info && $version_info =~ /^OpenSSH_([\d\.]+)/) {
+ my $v = $1;
+ if ($v && $v < 4.1) {
+ die "OpenSSH version $v, should be >= 4.1!\n";
+ }
+ }
+}
+
__END__
=head1 NAME

0 comments on commit a9431df

Please sign in to comment.