Created
December 17, 2010 14:34
-
-
Save cole/745022 to your computer and use it in GitHub Desktop.
Update Zoneedit dynamic DNS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/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