Skip to content

Instantly share code, notes, and snippets.

@thinkjson
Last active December 17, 2015 15:59
Show Gist options
  • Select an option

  • Save thinkjson/5635676 to your computer and use it in GitHub Desktop.

Select an option

Save thinkjson/5635676 to your computer and use it in GitHub Desktop.
Notify when instance is running
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