This morning I'm seeing this error when the script looks at
www.whatismyip.com for the assigned IP address:

/home/rshepard/shell-scripts/ngetip.sh: line 4: [: too many arguments

   What is recommended for error checking and graceful recovery in a bash
shell script like mine? BTW, I can point the browser to that URL and it does
load so I don't know why the script is retuning this error.

   mgetip.sh:

#!/bin/bash
OLDIP=$(cat /home/rshepard/CURRENTIP)
NEWIP=$(curl -s http://automation.whatismyip.com/n09230945.asp) 
if [ $NEWIP != $OLDIP ];  then # This is line 4
     echo $OLDIP
     echo $NEWIP
     echo $NEWIP > "/home/rshepard/CURRENTIP"
     echo $NEWIP >> "/home/rshepard/getiplog"
     <curl commands removed.>
fi

TIA,

Rich

_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to