From 9f71fe31a6f100a1f60f09c1b2b0651b9f2cdd46 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Fri, 22 May 2026 02:21:50 -0400 Subject: [PATCH] Development --- routlin/install.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/routlin/install.py b/routlin/install.py index 129449b..7e37bc0 100644 --- a/routlin/install.py +++ b/routlin/install.py @@ -418,13 +418,15 @@ def setup_caddy(domain, email): def _lan_ip(): - """Best-effort local LAN IP for the informational message.""" + """Read the LAN IP from routlin's networkd config files.""" + import glob try: - s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - s.connect(("8.8.8.8", 80)) - return s.getsockname()[0] + for path in sorted(glob.glob("/etc/systemd/network/10-routlin-*.network")): + for m in re.finditer(r'^Address=(\d+\.\d+\.\d+\.\d+)/', Path(path).read_text(), re.MULTILINE): + return m.group(1) except Exception: - return "127.0.0.1" + pass + return "this server" # ===================================================================