If you have a web server running on your linode and another location on a Dynamic DNS, and would like to update linode's DNS without logging in via ssh, here's my implementation.
The script compares the current WAN IP to the previous WAN IP and only updates when necessary.
The BBCode editor seems to be mangling the code, so it's probably going to be easier to just pick it up on my website:
http://www.cnysupport.com/index.php/lin ... ate-script
Have fun!
Terry
-------------------------------
This is a PHP script that returns the IP address of the client. Create this file in the web root on your web server.
Save As: MyIP.php
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
-------------------------------
This is a shell script that runs on the remote (dynamic) machine. Name it anything you like and put it /etc/cron.hourly.
Change the variables to reflect your settings.
It only updates the DNS when your WAN IP has actually changed.
You can pick up this entire document without any weird formatting at:
http://www.cnysupport.com/Linode_DDNS.txt
#!/bin/sh
LINODE_API_KEY=your linode key
DOMAIN_ID=your domain id
RESOURCE_ID=your resource id
WAN_IP=`wget -O - -q
http://www.sampledomain.com/MyIP.php`
OLD_WAN_IP=`cat /var/CURRENT_WAN_IP.txt`
if [ "$WAN_IP" = "$OLD_WAN_IP" ]; then
echo "IP Unchanged"
else
echo $WAN_IP > /var/CURRENT_WAN_IP.txt
wget -qO-
https://api.linode.com/?api_key="$LINODE_API_KEY"\&api_action=domain.resource.update\&DomainID="$DOMAIN_ID"\&ResourceID="$RESOURCE_ID"\&Target="$WAN_IP"
fi
--------------------------