On Tue, Feb 08, 2000 at 10:46:47AM +0600, Md. Sifat Ullah Patwary wrote:
> How can I know whether environment variable RELAYCLIENT is set and what its
> value is?
Where?
It's major use is in combination with tcpserver.
Here's a little test daemon that could be used to show the concept:
--%<--- cut here ---
#!/usr/bin/perl
# testd.pl; Magnus Bodin; [EMAIL PROTECTED]
use strict;
while (<>)
{
my $file = "$^T.$$";
open LOG, ">$file" or die "couln't open $file: $!";
foreach (sort keys %ENV)
{
chomp;
print LOG "$_ = $ENV{$_}\n";
}
close LOG;
}
--%<--- cut here ---
Here's the contents of tcp.test at a start:
127.0.0.1:allow,RELAYCLIENT=""
:allow
Rebuild tcp.test.cdb like this:
tcprules ./tcp.test.cdb ./tcp.test.tmp < ./tcp.test
And start the daemon like this:
tcpserver -v -xtcp.test.cdb 0 4000 ./testd.pl &
telnet to port 4000 from different machines and with different content in
tcp.test.cdb (see manual for tcpserver in ucspi-tcp-package.
Look in the logfiles for results.
/magnus
--
http://x42.com/