#!/bin/sh

hosts=( 'your.host.tld' )
user='username'
pass_enc='password using base64'
lastipfile='/tmp/lastip'
pass=`echo $pass_enc | base64 -d`
myip=`dig a myip.opendns.com @resolver1.opendns.com +short`
lastip=`cat $lastipfile`

if [ "$myip" != "$lastip" ]; then
  for host in ${hosts[@]};
    do
      URL="https://dyndns.dns-stock.com/?hostname=$host&username;=$user&password;=$pass&myip;=$myip"
      wget -O /dev/null --quiet --no-check-certificate $URL
      echo $myip > $lastipfile
      touch $lastipfile
  done
else
  echo "IP did not change!" > /dev/null
fi

Add a code snippet to your website: www.paste.org