From 44bc2339d0533bde8df1c2a18f9ffc017cb93524 Mon Sep 17 00:00:00 2001 From: ospab Date: Tue, 26 May 2026 22:08:51 +0300 Subject: [PATCH] fix: detect real public IP for panel URL output --- scripts/install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 018896c..47b548a 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -141,6 +141,13 @@ ln -sf "$INSTALL_DIR/ostp" "$BIN_LINK" echo "Symlink created: $BIN_LINK -> $INSTALL_DIR/ostp" echo "You can now run 'ostp' from anywhere." +# ── Detect public IP ───────────────────────────────────────────────── + +SERVER_IP=$(curl -4s https://ifconfig.me 2>/dev/null \ + || curl -4s https://api.ipify.org 2>/dev/null \ + || curl -4s https://icanhazip.com 2>/dev/null \ + || hostname -I | awk '{print $1}') + # ── Update detection ───────────────────────────────────────────────── if [ -f "$CONFIG_FILE" ]; then @@ -284,7 +291,7 @@ PYEOF echo "" echo "========================================================" echo "Panel configured!" - echo "URL: http://:$PANEL_PORT/$WEBPATH/" + echo "URL: http://$SERVER_IP:$PANEL_PORT/$WEBPATH/" echo "Username: $USERNAME" echo "Password: $PASSWORD" echo "========================================================" @@ -404,7 +411,7 @@ with open('$CONFIG_FILE', 'w') as f: echo "" echo "========================================================" echo "Panel installed successfully!" - echo "URL: http://:$PANEL_PORT/$WEBPATH/" + echo "URL: http://$SERVER_IP:$PANEL_PORT/$WEBPATH/" echo "Username: $USERNAME" echo "Password: $PASSWORD" echo "========================================================"