Update dynamic IP in NOIP service

27 || 0  || 2018-04-18 07:54:47 || root || || Bash

This script allows you to update your dynamic IP address in NOIP service. Don't forget to replace firstname_lastname@gmail.com, my_password and example.zapto.org with real values.

Save this script somewhere and add it to cron:

  • crontab -e
  • */30 * * * * /usr/local/bin/noip.sh

#!/bin/sh

noip()
{
echo ""
if [ $# != 3 ] ; then
        echo "IPUpdate script"
        echo "usage: $0 <LOGIN-NAME> <PASSWORD> <IPADR> <HOSTNAME>"
        exit
fi
# Update Host entry
RESULT=`curl -A " \"Ubuntu Server Update / firstname_lastname@gmail.com \"" -u $1:$2 "http://dynupdate.no-ip.com/nic/update?hostname=$3"`
echo "DNS entry update result for $3 : $RESULT"
}

noip firstname_lastname@gmail.com my_password example.zapto.org