#!/usr/bin/python3 #------------------------------------------------------# # Author: Evuraan Gmail dot com # # Scope : Reboot tp-link TC-7610 cable modem # # ---------------------------------------------------- # # Freely given, no warranty, use at your own risk etc. # # ---------------------------------------------------- # import requests,sys payload = {"loginUsername":"admin", "loginPassword":"admin"} url = "http://192.168.100.1/goform/login" _timeout = (10,4) rebooturl = "http://192.168.100.1/goform/top" headers = {'user-agent': '', "Referer": 'http://192.168.100.1/index.htm',} if __name__ == "__main__": try: with requests.Session() as s: r = s.post(url, data=payload, headers=headers, timeout=_timeout) reboot = s.post(rebooturl,headers=headers, timeout=_timeout, data = {'TopReboot':'1'}) print("Rebooted.") except: print('Failed to reboot, please intervene.') sys.exit(1)