Last active
December 17, 2015 15:59
-
-
Save thinkjson/5635676 to your computer and use it in GitHub Desktop.
Notify when instance is running
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 sys | |
| import subprocess | |
| import requests | |
| import time | |
| """ Notify when instance is running | |
| Invocation: | |
| python instance_running.py [hostname] | |
| """ | |
| running = False | |
| while not running: | |
| try: | |
| requests.get("http://" + sys.argv[1]) | |
| running = True | |
| except Exception as e: | |
| print e.message | |
| time.sleep(1) | |
| subprocess.call("say instance is running", shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment