Skip to content

Instantly share code, notes, and snippets.

@tacitochaves
Created June 5, 2014 14:59
Show Gist options
  • Select an option

  • Save tacitochaves/548eabf8209adaae9883 to your computer and use it in GitHub Desktop.

Select an option

Save tacitochaves/548eabf8209adaae9883 to your computer and use it in GitHub Desktop.
updatedns.sh
#!/bin/bash
TMPDIR=/tmp
IP=`lynx --source http://meuip.datahouse.com.br |grep meuip-home|cut -d\< -f3|awk '{print $5}';`
if [ ! -e ${TMPDIR}/ddns.ip ]; then
echo "0.0.0.0" > ${TMPDIR}/ddns.ip
fi
if [ "$IP" != `cat ${TMPDIR}/ddns.ip` ]; then
echo "IP mudou"
./nsupdate.sh $IP
echo $IP > ${TMPDIR}/ddns.ip
else
echo "nao mudou!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment