-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhsreboot.py
31 lines (20 loc) · 904 Bytes
/
hsreboot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
import requests
__author__ = 'dave'
HOTSPOT_IP = "192.168.1.1"
HOTSPOT_PASSWORD = "dadcyirh"
if __name__ == "__main__":
session = requests.Session()
session.get("http://" + HOTSPOT_IP + "/model.json")
session_id = session.cookies.get("sessionId")
token = session_id[session_id.find("-")+1:]
init_form_dict = {"session.password": HOTSPOT_PASSWORD,
"ok_redirect": "/success.json",
"err_redirect": "/error.json",
"token": token}
session.post("http://" + HOTSPOT_IP + "/Forms/config", init_form_dict)
restart_form_dict = {"general.shutdown": "Restart",
"ok_redirect": "/success.json",
"err_redirect": "/error.json",
"token": token}
session.post("http://" + HOTSPOT_IP + "/Forms/config", restart_form_dict)