Hi Ed,

On Sat, June 7, 2008 8:25 pm, Edward Kerr wrote:
> Hello all,
>
> I am about to include about this script in my /etc/rc.local file
>
> It logs me in to OpenDNS
>
> Before I bore you with the script - which I found on the web - my
> question is:
>
> How can I get it to produce an output in a log / text file so I can see
> what it did and if it was successful?
>
> Here is the script:
>
>
>
>
> UNAME=xxx             # username
> PWORD=xxx             # password (plaintext, sorry!)
> TEMP=/tmp/tmp.ddns    # temporary file
> ERROR=5                       # times to retry
>
> trap cleanup 1 2 3 6
> cleanup()
> {
>     rm $TEMP
>     exit 1
> }
>
> update()
> {
>       wget --quiet --no-check-certificate -O $TEMP
> 'http://'$UNAME':'$PWORD'@updates.dnsomatic.com/nic/update?'
>
>       if [ `cat $TEMP | grep -c good` = 1 ]
>       then
>               logger OpenDNS updated successfully
>       else
>               while [ $ERROR -gt 0 ]; do
>                       ERROR=$(($ERROR-1))
>                       sleep 10s
>                       update
>               done
>               logger OpenDNS update failed
>       fi
> }
>
> update
> rm $TEMP
> exit 0
>
>
>
>
> I have tried to find a file called /tmp/tmp.ddns after running the
> script, but it is not there!

Comment out the 'rm $TEMP' line and you will be able to find it.

Is this to keep your dynamic DNS address updated?

Malc
-- 
Web Development, Technical Copy-Editing & Proofreading

KDE Proofreading Team
KDE British English Translation Team

http://l10n.kde.org/team-infos.php?teamcode=en_GB


_______________________________________________
Peterboro mailing list
Peterboro@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/peterboro

Reply via email to