Posts

Showing posts from March, 2017

GoDaddyPy autoupdate example

Reference: To get godaddypy https://pypi.python.org/pypi/GoDaddyPy To get API key and secert https://developer.godaddy.com/getstarted root@radius02:~/godaddy# crontab -l 5 * * * * /usr/local/bin/GoDaddy.sh root@radius02:~/godaddy# cat /usr/local/bin/GoDaddy.sh #!/bin/sh myip=`dig a 3rd free domain name @8.8.8.8 +short` lastip=`dig a godaddy domain name @8.8.8.8 +short` if [ "$myip" != "$lastip" ]; then python2 /usr/local/bin/godaddy_ddns.py fi root@radius02:~/godaddy# cat /usr/local/bin/godaddy_ddns.py #!/usr/bin/env python import pif import datetime from godaddypy import Client, Account import requests import urllib3 # Suppress InsecureRequestWarning: Unverified HTTPS urllib3.disable_warnings() domain=' godaddy domain name ' public_ip = pif.get_public_ip() my_acct = Account(api_key=' Key ', api_secret=' secret ') client = Client(my_acct) client.get_domains() #client.get_a_records(domain) client.get_re...