On Sat, 3 Mar 2012, Dale Snell wrote:

> First thing I'd do is put quotes around the variables in the test:
>
>    if [ "$NEWIP" != "$OLDIP" ]; then

Dale,

   Done.

> Second thing would be to put some rudimentary error checking ahead
> of the test, after $NEWIP is set:
>
>    if [ -z "$NEWIP" ]; then
>        echo "FATAL: curl did not return a new IP"
>        exit 2
>    fi

   Done.

> Third, run the script with the -x flag:
>    $ bash -x ngetip.sh
> This puts bash in xtrace mode, which makes debugging much easier. It will
> let you see what is being returned for $NEWIP.  Once you know that, you
> can set up your input filtering.  Or you could simply add echo statements
> in strategic locations.  Whatever works for you.

    Errors checking for the current IP address have happened only 4 or 5
times since the switch to DHCP. No way to predict when it happens. And, when
it does occur, the next check (in 15 minutes) works properly.

Thanks,

Rich

_______________________________________________
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to