From: minima Date: Thu, 22 Feb 2001 14:25:13 +0000 (+0000) Subject: added operating system to sh/version X-Git-Tag: R_1_47_PRE1~11 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d4074d9835e4c0f7d6d66b9f7eaf522f9ba25728;p=spider.git added operating system to sh/version changed lineending for telnet sessions to be \r\n instead of plain \n added lineend '\r\n' command for custom lineendings --- diff --git a/Changes b/Changes index fa32dd39..c4810f8c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +22Feb01======================================================================= +1. Added platform name to sh/version +2. changed client.pl so that it send \r\n instead of \n on telnet connects +3. added lineend '\r\n' command to connect scripts so you can override +defaults 03Feb01======================================================================= 1. Changes and additions to the manual and added a help file for sh/log (g0vgs) 13Jan01======================================================================= diff --git a/cmd/show/version.pl b/cmd/show/version.pl index 508ac235..b9bb9501 100644 --- a/cmd/show/version.pl +++ b/cmd/show/version.pl @@ -8,7 +8,7 @@ my @out; -push @out, "DX Spider Cluster version $main::version"; +push @out, "DX Spider Cluster version $main::version on \u$^O"; push @out, "Copyright (c) 1998-2001 Dirk Koopman G1TLH"; return (1, @out); diff --git a/perl/client.pl b/perl/client.pl index 5e975c15..06d4cbc4 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -88,8 +88,10 @@ sub setmode { if ($mode == 1) { $mynl = "\r"; + $out_lineend = "\r"; } else { $mynl = "\n"; + $out_lineend = "\r\n"; } $/ = $mynl; } @@ -265,6 +267,16 @@ sub dotimeout $timeout = $val; } +sub dolineend +{ + my $val = shift; + $out_lineend = $val; + $out_lineend =~ s/\\r/\r/g; + $out_lineend =~ s/\\n/\n/g; + dbg('connect', "lineend set to $val "); + $out_lineend = $mynl unless $out_lineend; +} + sub dochat { my ($expect, $send) = @_; @@ -304,9 +316,10 @@ sub dochat } if ($send) { if ($csort eq 'telnet') { - $sock->print("$send\n"); + local $\ = $out_lineend; + $sock->print("$send$out_lineend"); } elsif ($csort eq 'ax25') { - local $\ = "\r"; + local $\ = $out_lineend; $wfh->print("$send"); } dbg('connect', "sent \"$send\""); @@ -350,6 +363,7 @@ $maxecho = 5; # length of max echo queue $pid = 0; # the pid of the child program $csort = ""; # the connection type $sock = 0; # connection socket +$out_lineend = $mynl; # connection lineending (used for outgoing connects) $stdin = *STDIN; $stdout = *STDOUT; @@ -444,7 +458,9 @@ if ($connsort eq "connect") { doconnect($1, $2) if /^\s*co\w*\s+(\w+)\s+(.*)$/io; doabort($1) if /^\s*a\w*\s+(.*)/io; dotimeout($1) if /^\s*t\w*\s+(\d+)/io; + dolineend($1) if /^\s*[Ll]\w*\s+\'((?:\\[rn])+)\'/; dochat($1, $2) if /^\s*\'(.*)\'\s+\'(.*)\'/io; + if (/^\s*cl\w+\s+(.*)/io) { doclient($1); last;