From 0c0ef7530425e8e19d1a3c7eda4b704fc59fb2e4 Mon Sep 17 00:00:00 2001 From: Tobias Date: Sat, 10 Oct 2026 23:45:30 +0000 Subject: [PATCH] Update ping.py --- ping.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ping.py b/ping.py index fff66cf..17772e4 100644 --- a/ping.py +++ b/ping.py @@ -11,13 +11,13 @@ import subprocess file = "status.json" -#dictionary containing current server hostnames/ips +#creating dictionary containing current server hostnames/ips from json -servers = { - "link": "1.2.3.4", - "ganon": "5.6.7.8", - "zelda": "9.10.1.12", -} +try: + with open("/root/servers.json") as f: + servers = json.load(f) +except FileNotFoundError: + raise RuntimeError("servers json file not found")