mirror of
https://github.com/duncs/clusterssh.git
synced 2025-04-22 09:22:24 +00:00
Look for usernames when adding clusters
Removes and stores the username portion of a server before checking if it's a cluster or not to allow dynamic username selection in the GUI too.
This commit is contained in:
parent
cbb31ca09c
commit
d604feee25
3 changed files with 16 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.28
|
||||
|
||||
* Look for usernames when adding clusters
|
||||
- Thanks to Kristian Lyngstol for the patch
|
||||
|
||||
2009-09-24 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.27
|
||||
|
||||
* Add in list of clusters to 'Add Host' window
|
||||
|
|
1
THANKS
1
THANKS
|
@ -30,5 +30,6 @@ Bogdan Pintea
|
|||
Gerfried Fuchs
|
||||
Stanislas Rouvelin
|
||||
Sami Kerola
|
||||
Kristian Lyngstol
|
||||
|
||||
$Id$
|
||||
|
|
12
src/cssh.pl
12
src/cssh.pl
|
@ -689,10 +689,18 @@ sub resolve_names(@) {
|
|||
my @servers = @_;
|
||||
|
||||
foreach (@servers) {
|
||||
my $dirty = $_;
|
||||
my $username = "";
|
||||
my $node;
|
||||
logmsg( 3, "Found server $_" );
|
||||
|
||||
if ( $clusters{$_} ) {
|
||||
push( @servers, split( / /, $clusters{$_} ) );
|
||||
if ( $dirty =~ s/^(.*)@// ) {
|
||||
$username = $1;
|
||||
}
|
||||
if ( $clusters{$dirty} ) {
|
||||
foreach $node (split( / /, $clusters{$dirty})) {
|
||||
push( @servers, $username . "@" . $node );
|
||||
}
|
||||
$_ = "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue