[wplug] IPCop script
Arnaud
Arnaud at mindspring.com
Mon Jun 16 13:57:18 EDT 2003
No, it was composed in Vi.
-----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
_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug
More information about the wplug
mailing list