mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-03 01:43:25 +00:00
Fix 'ctel', 'crsh' and 'ccon'
The code wasn't taking into account being called under another name correctly, so wasn't calling the correct comms method.
This commit is contained in:
parent
6eb3cdc2e4
commit
521b1fd37c
3 changed files with 14 additions and 5 deletions
|
@ -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} } ) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue