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:

PEER=`/home/reed/src/getpeername`
echo $PEER >> /tmp/peer.ip

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


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to