diff --git a/Changes b/Changes index 1335111..581fa2f 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ ????-??-?? Duncan Ferguson - v4.01_02 * Fix logic when using 'autoclose' on the command line or config file * Fix $HOME/.clusterssh/clusters being read in +* Fix 'ctel', 'crsh' and 'ccon'so they work as expected 2011-12-09 Duncan Ferguson - v4.01_01 * Include missing files from release tarballs diff --git a/lib/App/ClusterSSH/Config.pm b/lib/App/ClusterSSH/Config.pm index dbe7c42..6a57c7c 100644 --- a/lib/App/ClusterSSH/Config.pm +++ b/lib/App/ClusterSSH/Config.pm @@ -4,7 +4,7 @@ use strict; use warnings; use version; -our $VERSION = version->new('0.01'); +our $VERSION = version->new('0.02'); use Carp; use Try::Tiny; @@ -84,12 +84,17 @@ sub new { my $self = $class->SUPER::new(%default_config); ( my $comms = $Script ) =~ s/^c//; - $self->{comms} = $comms; + + $comms = 'telnet' if ( $comms eq 'tel' ); + $comms = 'console' if ( $comms eq 'con' ); # list of allowed comms methods - if ( 'ssh rsh telnet console' !~ m/\B$comms\B/ ) { + if ( 'ssh rsh telnet console' !~ m/\b$comms\b/ ) { $self->{comms} = 'ssh'; } + else { + $self->{comms} = $comms; + } if ( $self->{comms} && ( !$self->{ $self->{comms} } || !-e $self->{ $self->{comms} } ) ) diff --git a/lib/App/ClusterSSH/Helper.pm b/lib/App/ClusterSSH/Helper.pm index 39e272a..6921cbf 100644 --- a/lib/App/ClusterSSH/Helper.pm +++ b/lib/App/ClusterSSH/Helper.pm @@ -4,7 +4,7 @@ use strict; use warnings; use version; -our $VERSION = version->new('0.01'); +our $VERSION = version->new('0.02'); use Carp; use Try::Tiny; @@ -119,7 +119,10 @@ sub script { \$command .= "\$svr"; } } - \$command .= " \\\"$command\\\" ; $postcommand"; + if("$command") { + \$command .= " \\\"$command\\\""; + } + \$command .= " ; $postcommand"; warn("Running:\$command\\n"); # for debug purposes exec(\$command); HERE