# Changeip.com Script for Linux base systems using bash
# Created to suite local need in specific case. Well tested with CENTOS 6.x n UBUNTU 12.x
# Syed . Jahanzaib . aacable at hotmail dot com
# Uncomment below to view debug log
# Various variables, make sure to change the changeip.com credentials and hostname as required.
URL="http://nic.changeip.com/nic/update?ip"
# Temp files and log file to record updates if required
EXTIP="/tmp/externalip.txt"
LOG="/var/log/changeip.log"
# If external ip text file not found, then create one
if [ ! -e "$EXTIP" ] ; then
# Download current LIVE ip from intenret to match with old ip
wget -q -O /tmp/newip.txt http://ip.changeip.com:8245
b=`cat $NEWIP | cut -f 2 -d "=" | cut -f 1 -d "-" -s | grep -m 1 ^`
curl -4 "$URL=$b&u=$CIPUSER&p=$CIPPASS&hostname=$CIPHOST"
# Update New WAN IP in OLD File
# Print OLD vs New Comparision for REVIEW
# Print OLD vs New Comparision for REVIEW in LOG FILE for later review
echo "*********************************************" >> $LOG
echo New IP found at $DATE and IP is = $b >> $LOG
# IF OLD and NEW ip are same, then no need to update, just EXIT
echo $DATE / No need to change IP. DDNS BASH Script / Powered by Syed Jahanzaib