Last active
August 29, 2015 14:17
-
-
Save thinkjson/a1dd76af455dceb8e4aa to your computer and use it in GitHub Desktop.
Check to see when DNS for a new host has propagated
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
| import requests | |
| import sys | |
| import time | |
| import subprocess | |
| if len(sys.argv) != 2: | |
| print 'Usage: new_host_DNS.py [url]' | |
| sys.exit(0) | |
| NX = True | |
| while NX: | |
| try: | |
| response = requests.get(sys.argv[1]) | |
| NX = False | |
| except requests.exceptions.ConnectionError: | |
| sys.stdout.write('.') | |
| sys.stdout.flush() | |
| time.sleep(1) | |
| print '' | |
| print 'DNS has propagated' | |
| subprocess.call(['say', 'DNS', 'has', 'propagated']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment