From 255ae4f30d64d9e8e5e2e89d2a51f10558c29327 Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Mon, 5 Jan 2026 13:56:02 -0500 Subject: [PATCH] Fix MOTD port 443 detection (check service not iptables) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iptables requires root to read NAT rules. Instead check if the iptables-restore service is enabled, which indicates 443 redirect was configured. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- rpi/setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpi/setup.sh b/rpi/setup.sh index e6ae438..39aae79 100755 --- a/rpi/setup.sh +++ b/rpi/setup.sh @@ -314,7 +314,8 @@ if systemctl is-active --quiet stegasoo 2>/dev/null; then PI_IP=$(hostname -I | awk '{print $1}') # Check if HTTPS and port 443 are configured if systemctl show stegasoo -p Environment 2>/dev/null | grep -q "STEGASOO_HTTPS_ENABLED=true"; then - if iptables -t nat -L PREROUTING 2>/dev/null | grep -q "dpt:https.*5000"; then + # Check for port 443 redirect (iptables-restore service means 443 is configured) + if systemctl is-enabled --quiet iptables-restore 2>/dev/null; then STEGASOO_URL="https://$PI_IP" else STEGASOO_URL="https://$PI_IP:5000"