[wplug] IPCop script

Vanco, Donald VANCOD at PIOS.com
Mon Jun 16 14:17:11 EDT 2003


Arnaud wrote:
> No, it was composed in Vi.

	Another possibly stupid question - but this script is known to work
with the version of icop you have?  The scripts referenced in /etc/rc.d do
exists and are executable?  What happens if you fire them off on their own?
Did you cut-n-paste or manually type this stuff?  Do you have a pointer to
the original reference?

Don

> 
> -----Original Message-----
> From: wplug-admin at wplug.org [mailto:wplug-admin at wplug.org] On Behalf
> Of Vanco, Donald
> Sent: Monday, June 16, 2003 1:46 PM
> To: 'wplug at wplug.org'
> Subject: RE: [wplug] IPCop script
> 
> 
> Arnaud Loos wrote:
>> I'm trying to use a script on my ipcop box that runs every 5 minutes
>> and checks to see if my IP has changed. If it has then bring the
>> network down and up with the new ip. The script is as follows.
>> 
>> #!/bin/sh
>> 
>> ping -c1 `netstat -rn | grep ^0.0.0.0 | awk '{print $2}'`
>> 
>> if [ "$?" != "0" ] ; then
>> 	/etc/rc.d/netaddress.down
>> 	/etc/rc.d/netaddress.up
>> fi
>> 
>> I copied this script from ipcop's archives. When I run it manually,
>> the packet goes out, I get the reply, and then I get the error:
>> 
>> /usr/local/sbin/checkconnect: [: missing ']'
>> 
>> Any ideas where I messed up the syntax?
> 
> 	I don't see anything at first glance.  Just out of curiosity -
> did you do any editing of / pass this file through a Windoze box? 
> I've had lots of scripts get muddled by thinking "a text editor is a
> text editor"..... just a thought...
> 
> Don
> 



More information about the wplug mailing list