diff --git a/script/singbox.sh b/script/singbox.sh index eda7dcb..eadb35b 100644 --- a/script/singbox.sh +++ b/script/singbox.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # install_singbox.sh # 版本号 -SCRIPT_VERSION="1.12.1" +SCRIPT_VERSION="1.12.1-alapa" set -euo pipefail # 颜色定义 @@ -19,7 +19,8 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -CONFIG_DIR=/etc/singbox +# 修复:使用正确的配置目录 +CONFIG_DIR=/etc/sing-box STATE_FILE="$CONFIG_DIR/state.env" BIN_NAME=sing-box @@ -88,54 +89,72 @@ install_singbox() { PUB_KEY=$(echo "$KEY_OUTPUT" | awk -F': ' '/PublicKey/ {print $2}') SHORT_ID=$(openssl rand -hex 8) FP="chrome" - SERVER_IP=$(curl -s https://ifconfig.me) + SERVER_IP=$(curl -4 -s https://api.ipify.org) PORT=443 SPX="/" mkdir -p "$CONFIG_DIR" + + # 修复:更新为新的配置格式 cat >"$CONFIG_DIR/config.json" <