syncthing-monitor/syncthing_monitor/__main__.py

18 lines
433 B
Python
Raw Normal View History

2021-01-28 13:31:25 +00:00
from syncthing_monitor.config_xml import parse_api_key, set_listen_ip_to_any
from syncthing_monitor.syncthing_rest import get_device_id
2021-01-28 10:56:11 +00:00
2021-01-28 13:31:25 +00:00
def loop(gui_port="8384", host="sync"):
2021-01-28 10:56:11 +00:00
api_key = parse_api_key()
print("Found API Key: {0}".format(api_key))
2021-01-28 13:31:25 +00:00
set_listen_ip_to_any()
device_id = get_device_id(host, gui_port, api_key)
print("Found Device ID: {0}".format(device_id))
2021-01-28 10:56:11 +00:00
if __name__ == "__main__":
loop()