Thanks, Mick.

On Wed, Mar 5, 2008 at 12:08 PM, Michael Graham wrote:
>  (Sorry Dave I keep hitting reply and not reply to list)
Yes, I keep doing that :)

>  External helps are not supposed to exit once they have completed a
>  request.  Your perl script should read from stdin then write OK/ERR then
>  wait for more input.
Ah!

So this should work?

 1:#!/usr/bin/perl
 2:while(1){
 3:  $| = 1;
 4:  $ip=<STDIN>;
 5:  $ip=chomp($ip);
 6:  $ipfile='/var/www/apache2-default/cgi-bin/ips/'.$ip;
 7:  #print $ipfile;
 8:  if (-e $ipfile){print "OK";}
 9:  else {print "ERR : ".$ip;}
10:}

I'll try it right now.

Reply via email to