
sgifford at suspectclass
Oct 13, 2003, 10:50 PM
Post #2 of 2
(969 views)
Permalink
|
|
Re: How to include value of an environment variable in a tcp rule
[In reply to]
|
|
Sagara Wijetunga <sagaralists[at]yahoo.com> writes: > Hi all > > The tcpserver program sets up several environment > variables (eg. $TCPLOCALIP, TCPREMOTEIP, etc.) for TCP > connections. > > Is it possible to include the value of an environment > variable in a tcp rule to create a new environment > variable? > > Eg. > :allow,NEWVAR="something/Value of > $TCPLOCALIP/something" [...] Not this way, but you can accomplish this by having tcpserver call a wrapper script. For example, if you're currently running tcpserver 0 25 /var/qmail/bin/qmail-smtpd you could change it to tcpserver 0 25 /var/qmail/bin/env-wrapper /var/qmail/bin/qmail-smtpd and have env-wrapper be a short shell script like this: #!/bin/sh NEWVAR="something/$TCPLOCALIP/something" export NEWVAR exec "$@" ----ScottG.
|