PhilV, you can try the folllowing.
Change to a directory of your chosing.
Open a new file. ie vi update.sh
Enter in the following code (change words that start with a % to your values)
#!/bin/bash
curr_ip=wget -q -O- http://www.whatismyip.com/ | grep "Your IP is " - | cut -d" " -f4
old_ip=cat ip.tmp
logger -t dyndns.org "Stored IP : $old_ip"
logger -t dyndns.org "Current IP: $curr_ip"
if [ "$old_ip" = "$curr_ip" ]; then
logger -t dyndns.org "Action: no update"
else
logger -t dyndns.org "Action: update"
/sbin/e-smith/dynamic-dns/dyndns.org $curr_ip %username %password %domain
echo $curr_ip > ip.tmp
logger -t dyndns.org "Status: updated"
fi
Hmm, had a go at this, but at the point where we are trying to get curr_ip and old_ip, rather than execute the instructions in the single quotes, it seems to just place that text into the variable. i.e.
$old_ip ends up containing:
cat ip.tmp
I can tell this by looking in my /var/log/messages
Any ideas how to fix this?
Thx,
Phil