mirror of https://github.com/ospab/ostp.git
fix: detect real public IP for panel URL output
This commit is contained in:
parent
0611b96622
commit
247671de6c
|
|
@ -141,6 +141,13 @@ ln -sf "$INSTALL_DIR/ostp" "$BIN_LINK"
|
||||||
echo "Symlink created: $BIN_LINK -> $INSTALL_DIR/ostp"
|
echo "Symlink created: $BIN_LINK -> $INSTALL_DIR/ostp"
|
||||||
echo "You can now run 'ostp' from anywhere."
|
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 ─────────────────────────────────────────────────
|
# ── Update detection ─────────────────────────────────────────────────
|
||||||
|
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
if [ -f "$CONFIG_FILE" ]; then
|
||||||
|
|
@ -284,7 +291,7 @@ PYEOF
|
||||||
echo ""
|
echo ""
|
||||||
echo "========================================================"
|
echo "========================================================"
|
||||||
echo "Panel configured!"
|
echo "Panel configured!"
|
||||||
echo "URL: http://<your_server_ip>:$PANEL_PORT/$WEBPATH/"
|
echo "URL: http://$SERVER_IP:$PANEL_PORT/$WEBPATH/"
|
||||||
echo "Username: $USERNAME"
|
echo "Username: $USERNAME"
|
||||||
echo "Password: $PASSWORD"
|
echo "Password: $PASSWORD"
|
||||||
echo "========================================================"
|
echo "========================================================"
|
||||||
|
|
@ -404,7 +411,7 @@ with open('$CONFIG_FILE', 'w') as f:
|
||||||
echo ""
|
echo ""
|
||||||
echo "========================================================"
|
echo "========================================================"
|
||||||
echo "Panel installed successfully!"
|
echo "Panel installed successfully!"
|
||||||
echo "URL: http://<your_server_ip>:$PANEL_PORT/$WEBPATH/"
|
echo "URL: http://$SERVER_IP:$PANEL_PORT/$WEBPATH/"
|
||||||
echo "Username: $USERNAME"
|
echo "Username: $USERNAME"
|
||||||
echo "Password: $PASSWORD"
|
echo "Password: $PASSWORD"
|
||||||
echo "========================================================"
|
echo "========================================================"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue