mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-03 09:53:23 +00:00
Move potential new helper code into the helper module
This commit is contained in:
parent
1d98a078dd
commit
78c71b5960
2 changed files with 51 additions and 108 deletions
|
@ -740,114 +740,6 @@ sub send_resizemove($$$$$) {
|
||||||
#$xdisplay->flush(); # dont flush here, but after all tiling worked out
|
#$xdisplay->flush(); # dont flush here, but after all tiling worked out
|
||||||
}
|
}
|
||||||
|
|
||||||
#sub setup_helper_script() {
|
|
||||||
# my($self) = @_;
|
|
||||||
# logmsg( 2, "Setting up helper script" );
|
|
||||||
# my $comms=$self->config->{comms};
|
|
||||||
# my $comms_args=$self->config->{$self->config->{comms}.'_args'} || '';
|
|
||||||
# my $command=$self->config->{command};
|
|
||||||
#
|
|
||||||
# # P = pipe file
|
|
||||||
# # s = server
|
|
||||||
# # u = username
|
|
||||||
# # p = port
|
|
||||||
# # m = ccon master
|
|
||||||
# # c = comms command
|
|
||||||
# # a = command args
|
|
||||||
# # C = command to run
|
|
||||||
# my $lelehelper_script = q{
|
|
||||||
# use strict;
|
|
||||||
# use warnings;
|
|
||||||
# use Getopt::Std;
|
|
||||||
# my %opts;
|
|
||||||
# getopts('PsupmcaC', \%opts);
|
|
||||||
# my $command="$opts{c} $opts{a}";
|
|
||||||
# open(PIPE, ">", $opts{P}) or die("Failed to open pipe: $!\n");
|
|
||||||
# print PIPE "$$:$ENV{WINDOWID}"
|
|
||||||
# or die("Failed to write to pipe: $!\\n");
|
|
||||||
# close(PIPE) or die("Failed to close pipe: $!\\n");
|
|
||||||
# if($opts{s} =~ m/==$/)
|
|
||||||
# {
|
|
||||||
# $opts{s} =~ s/==$//;
|
|
||||||
# warn("\nWARNING: failed to resolve IP address for $opts{s}.\n\n");
|
|
||||||
# sleep 5;
|
|
||||||
# }
|
|
||||||
# if($opts{m}) {
|
|
||||||
# unless("$comms" ne "console") {
|
|
||||||
# $opts{m} = $opts{m} ? "-M $opts{m} " : "";
|
|
||||||
# $opts{c} .= $opts{m};
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# if($opts{u}) {
|
|
||||||
# unless("$comms" eq "telnet") {
|
|
||||||
# $opts{u} = $opts{u} ? "-l $opts{u} " : "";
|
|
||||||
# $opts{c} .= $opts{u};
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# if("$comms" eq "telnet") {
|
|
||||||
# $command .= "$opts{s} $opts{p}";
|
|
||||||
# } else {
|
|
||||||
# if ($opts{p}) {
|
|
||||||
# $opts{c} .= "-p $opts{p} $opts{s}";
|
|
||||||
# } else {
|
|
||||||
# $opts{c} .= "$opts{s}";
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# #$command .= " $command || sleep 5";
|
|
||||||
# warn("Running:$command\n"); # for debug purposes
|
|
||||||
# exec($command);
|
|
||||||
# };
|
|
||||||
## $helper_script = <<" HERE";
|
|
||||||
## my \$pipe=shift;
|
|
||||||
## my \$svr=shift;
|
|
||||||
## my \$user=shift;
|
|
||||||
## my \$port=shift;
|
|
||||||
## my \$mstr=shift;
|
|
||||||
## my \$command="$config{$config{comms}} $config{$config{comms}."_args"} ";
|
|
||||||
## open(PIPE, ">", \$pipe) or die("Failed to open pipe: \$!\\n");
|
|
||||||
## print PIPE "\$\$:\$ENV{WINDOWID}"
|
|
||||||
## or die("Failed to write to pipe: $!\\n");
|
|
||||||
## close(PIPE) or die("Failed to close pipe: $!\\n");
|
|
||||||
## if(\$svr =~ m/==\$/)
|
|
||||||
## {
|
|
||||||
## \$svr =~ s/==\$//;
|
|
||||||
## warn("\\nWARNING: failed to resolve IP address for \$svr.\\n\\n"
|
|
||||||
## );
|
|
||||||
## sleep 5;
|
|
||||||
## }
|
|
||||||
## if(\$mstr) {
|
|
||||||
## unless("$config{comms}" ne "console") {
|
|
||||||
## \$mstr = \$mstr ? "-M \$mstr " : "";
|
|
||||||
## \$command .= \$mstr;
|
|
||||||
## }
|
|
||||||
## }
|
|
||||||
## if(\$user) {
|
|
||||||
## unless("$config{comms}" eq "telnet") {
|
|
||||||
## \$user = \$user ? "-l \$user " : "";
|
|
||||||
## \$command .= \$user;
|
|
||||||
## }
|
|
||||||
## }
|
|
||||||
## if("$config{comms}" eq "telnet") {
|
|
||||||
## \$command .= "\$svr \$port";
|
|
||||||
## } else {
|
|
||||||
## if (\$port) {
|
|
||||||
## \$command .= "-p \$port \$svr";
|
|
||||||
## } else {
|
|
||||||
## \$command .= "\$svr";
|
|
||||||
## }
|
|
||||||
## }
|
|
||||||
## \$command .= " $config{command} || sleep 5";
|
|
||||||
### warn("Running:\$command\\n"); # for debug purposes
|
|
||||||
## exec(\$command);
|
|
||||||
## HERE
|
|
||||||
#
|
|
||||||
# # eval $helper_script || die ($@); # for debug purposes
|
|
||||||
# #logmsg( 2, $helper_script );
|
|
||||||
# #logmsg( 2, "Helper script done" );
|
|
||||||
#
|
|
||||||
# return $self;
|
|
||||||
#}
|
|
||||||
|
|
||||||
sub open_client_windows(@) {
|
sub open_client_windows(@) {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
foreach (@_) {
|
foreach (@_) {
|
||||||
|
|
|
@ -26,6 +26,57 @@ sub script {
|
||||||
my $comms_args = $config->{$comms.'_args'};
|
my $comms_args = $config->{$comms.'_args'};
|
||||||
my $command = $config->{command};
|
my $command = $config->{command};
|
||||||
|
|
||||||
|
# # P = pipe file
|
||||||
|
# # s = server
|
||||||
|
# # u = username
|
||||||
|
# # p = port
|
||||||
|
# # m = ccon master
|
||||||
|
# # c = comms command
|
||||||
|
# # a = command args
|
||||||
|
# # C = command to run
|
||||||
|
# my $lelehelper_script = q{
|
||||||
|
# use strict;
|
||||||
|
# use warnings;
|
||||||
|
# use Getopt::Std;
|
||||||
|
# my %opts;
|
||||||
|
# getopts('PsupmcaC', \%opts);
|
||||||
|
# my $command="$opts{c} $opts{a}";
|
||||||
|
# open(PIPE, ">", $opts{P}) or die("Failed to open pipe: $!\n");
|
||||||
|
# print PIPE "$$:$ENV{WINDOWID}"
|
||||||
|
# or die("Failed to write to pipe: $!\\n");
|
||||||
|
# close(PIPE) or die("Failed to close pipe: $!\\n");
|
||||||
|
# if($opts{s} =~ m/==$/)
|
||||||
|
# {
|
||||||
|
# $opts{s} =~ s/==$//;
|
||||||
|
# warn("\nWARNING: failed to resolve IP address for $opts{s}.\n\n");
|
||||||
|
# sleep 5;
|
||||||
|
# }
|
||||||
|
# if($opts{m}) {
|
||||||
|
# unless("$comms" ne "console") {
|
||||||
|
# $opts{m} = $opts{m} ? "-M $opts{m} " : "";
|
||||||
|
# $opts{c} .= $opts{m};
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# if($opts{u}) {
|
||||||
|
# unless("$comms" eq "telnet") {
|
||||||
|
# $opts{u} = $opts{u} ? "-l $opts{u} " : "";
|
||||||
|
# $opts{c} .= $opts{u};
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# if("$comms" eq "telnet") {
|
||||||
|
# $command .= "$opts{s} $opts{p}";
|
||||||
|
# } else {
|
||||||
|
# if ($opts{p}) {
|
||||||
|
# $opts{c} .= "-p $opts{p} $opts{s}";
|
||||||
|
# } else {
|
||||||
|
# $opts{c} .= "$opts{s}";
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# #$command .= " $command || sleep 5";
|
||||||
|
# warn("Running:$command\n"); # for debug purposes
|
||||||
|
# exec($command);
|
||||||
|
# };
|
||||||
|
|
||||||
my $script = <<" HERE";
|
my $script = <<" HERE";
|
||||||
my \$pipe=shift;
|
my \$pipe=shift;
|
||||||
my \$svr=shift;
|
my \$svr=shift;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue