[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Remote IP for inetd "daemon"

On Wed, 19 Sep 2001, Robert Waldner wrote:

> >Then compile it with "gcc -o getpeername getpeername.c". Then use the
> >getpeername executable in your script.
> Hmm, this doesn´t work for me. If I invoke it via
> inetd.conf:
> sunrpc stream tcp nowait nobody /usr/local/bin/test.sh test.sh
> test.sh:
> #!/bin/bash
> /usr/local/bin/getpeername >>/tmp/peer.ip
> exit
> only a \n is logged to the file (so permissions et al are ok ;-) ).

The shell changes the standard input; try:

echo $PEER >> /tmp/peer.ip

  Jeremy C. Reed
  http://bsd.reedmedia.net/  -- BSD news and resources
  http://www.isp-faq.com/    -- find answers to your questions

Reply to: