Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2013 12:09:19 +0100
From:      =?utf-8?B?UmFkZWsgS3JlasSNYQ==?= <radek.krejca@starnet.cz>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Remote IP to script over inetd
Message-ID:  <5150305F.6000205@starnet.cz>

index | next in thread | raw e-mail

Hello,

I need to get remote ip of client who is runnig script over inetd. A
found that on linux is possible to use environment variable REMOTEHOST.
But if I try it on FreeBSD it doesnt work well. There is stored
something host but not actual. I thing that this variable is taken from
root environment and not show actual ip of client connected over port
serviced by inetd .

So question is - how I can get client ip addres to my script serviced by
inetd?

I am starting inetd only with inetd_enable in rc.conf, no other
attribues, so inetd i running:

/usr/sbin/inetd -wW -C 60

Its freebsd 9.1 amd64 and script looks like:

#!/bin/sh
echo $REMOTEHOST

I runs it on port 9000 serviced by inetd and started in inetd.conf

redirect       stream  tcp     nowait  root    /root/redirects.sh
redirects.sh

Thank you
Radek

help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5150305F.6000205>