Fix helper script and defaultport usage

This commit is contained in:
duncan_ferguson 2009-04-08 18:23:32 +00:00
parent 1d85a21872
commit 1325c6aead
2 changed files with 7 additions and 9 deletions

View file

@ -7,6 +7,7 @@
* Rearrange pod documentation to remove extraenous comment (Tony Mancill) * Rearrange pod documentation to remove extraenous comment (Tony Mancill)
* Cope better with IPv6 addresses * Cope better with IPv6 addresses
* Fix bug with passing arguments from command line to comms method binary * Fix bug with passing arguments from command line to comms method binary
* Rework defaultport code
2009-03-26 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.25-1 2009-03-26 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.25-1

View file

@ -828,7 +828,6 @@ sub send_resizemove($$$$$) {
sub setup_helper_script() { sub setup_helper_script() {
logmsg( 2, "Setting up helper script" ); logmsg( 2, "Setting up helper script" );
my $defaultport = ( defined $options{p} ) ? $options{p} : "";
$helper_script = <<" HERE"; $helper_script = <<" HERE";
my \$pipe=shift; my \$pipe=shift;
my \$svr=shift; my \$svr=shift;
@ -852,16 +851,14 @@ sub setup_helper_script() {
\$command .= \$user; \$command .= \$user;
} }
} }
if($config{comms} eq "telnet") { if("$config{comms}" eq "telnet") {
\$port = \$port ? "\$port" : "$defaultport";
\$command .= "\$svr \$port"; \$command .= "\$svr \$port";
} else { } else {
if ((\$port) || ("$defaultport" ne "")) { if (\$port) {
\$port = \$port ? "-p \$port" : "-p $defaultport"; \$command .= "-p \$port \$svr";
\$command .= "\$port \$svr"; } else {
} else {
\$command .= "\$svr"; \$command .= "\$svr";
} }
} }
\$command .= " || sleep 5"; \$command .= " || sleep 5";
# warn("Running:\$command\\n"); # for debug purposes # warn("Running:\$command\\n"); # for debug purposes
@ -932,7 +929,7 @@ sub split_hostname {
} }
} }
$port ||= q{}; $port ||= defined $options{p} ? $options{p} : q{};
$username ||= q{}; $username ||= q{};
logmsg( 3, "username=$username, server=$server, port=$port" ); logmsg( 3, "username=$username, server=$server, port=$port" );