Fix MOTD port 443 detection (check service not iptables)
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 <noreply@anthropic.com>
This commit is contained in:
@@ -314,7 +314,8 @@ if systemctl is-active --quiet stegasoo 2>/dev/null; then
|
|||||||
PI_IP=$(hostname -I | awk '{print $1}')
|
PI_IP=$(hostname -I | awk '{print $1}')
|
||||||
# Check if HTTPS and port 443 are configured
|
# 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 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"
|
STEGASOO_URL="https://$PI_IP"
|
||||||
else
|
else
|
||||||
STEGASOO_URL="https://$PI_IP:5000"
|
STEGASOO_URL="https://$PI_IP:5000"
|
||||||
|
|||||||
Reference in New Issue
Block a user