3 # Copyright Gerhard Rieger 2001
4 # Published under the GNU General Public License V.2, see file COPYING
6 # This script assumes that you create group daemon1 and user daemon1 before.
7 # they need only the right to exist (no login etc.)
9 # Note: this pid file mechanism is not robust!
11 # You will adapt these variables
14 INIF
=fwnonsec.domain.org
15 OUTIF
=fwsec.domain.org
16 TARGET
=w3.intra.domain.org
20 INOPTS
="fork,setgid=$GROUP,setuid=$USER"
22 PIDFILE
=/var
/run
/socat-
$INPORT.pid
23 OPTS
="-d -d -lm" # notice to stderr, then to syslog
24 SOCAT
=/usr
/local
/bin
/socat
26 if [ "$1" = "start" -o -z "$1" ]; then
28 $SOCAT $OPTS tcp-l
:$INPORT,bind=$INIF,$INOPTS tcp
:$TARGET:$DSTPORT,bind=$OUTIF,$OUTOPTS </dev
/null
&
31 elif [ "$1" = "stop" ]; then
33 /bin
/kill $
(/bin
/cat $PIDFILE)