Created
September 12, 2017 01:02
-
-
Save shanehull/ba649d7fabfd03a60663f74f5f3ce2d8 to your computer and use it in GitHub Desktop.
Script to reboot all Chromecasts on 172.16.31.1
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 | |
payload = {"params": "now"} | |
while True: | |
for ip in range (1, 255): | |
try: | |
print("working on 172.16.31.{}".format(ip)) | |
response = requests.post("http://172.16.31.{}:8008/setup/reboot".format(ip), json=payload, timeout=1.0) | |
if response.ok: | |
print("ok") | |
else: | |
print("failed") | |
print(response.status) | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment