Skip to content

Instantly share code, notes, and snippets.

@cole
Created December 17, 2010 14:34
Show Gist options
  • Select an option

  • Save cole/745022 to your computer and use it in GitHub Desktop.

Select an option

Save cole/745022 to your computer and use it in GitHub Desktop.
Update Zoneedit dynamic DNS
#/bin/bash
SCRIPT_NAME="Update Dynamic DNS"
HOSTNAME="athome.mysite.com"
USER="user"
PASSWORD="password"
DYNDNS_SERIVICE_URL="https://dynamic.zoneedit.com/auth/dynamic.html?host=${HOSTNAME}"
# Hit update server
RESPONSE=`/usr/bin/curl --silent --user $USER:$PASSWORD $DYNDNS_SERIVICE_URL`
if [ "${RESPONSE:1:7}" == "SUCCESS" ]
then
/usr/local/bin/growlnotify -p "Moderate" -n "${SCRIPT_NAME}" -m "${SCRIPT_NAME} completed"
/usr/bin/logger -i -p daemon.notice Result of DynDNS update: - "${SCRIPT_NAME} completed"
else
/usr/local/bin/growlnotify -p "Moderate" -n "${SCRIPT_NAME}" -m "${SCRIPT_NAME} failed. Error: ${RESPONSE}"
/usr/bin/logger -i -p daemon.notice Results of DynDNS update: - "${SCRIPT_NAME} failed, Error: ${RESPONSE}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment