mirror of
https://github.com/Dichgrem/singbox-example.git
synced 2025-12-18 12:31:59 -05:00
fix:legacy_json
This commit is contained in:
@@ -19,7 +19,8 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CONFIG_DIR=/etc/singbox
|
# 修复:使用正确的配置目录
|
||||||
|
CONFIG_DIR=/etc/sing-box
|
||||||
STATE_FILE="$CONFIG_DIR/state.env"
|
STATE_FILE="$CONFIG_DIR/state.env"
|
||||||
BIN_NAME=sing-box
|
BIN_NAME=sing-box
|
||||||
|
|
||||||
@@ -93,6 +94,8 @@ install_singbox() {
|
|||||||
SPX="/"
|
SPX="/"
|
||||||
|
|
||||||
mkdir -p "$CONFIG_DIR"
|
mkdir -p "$CONFIG_DIR"
|
||||||
|
|
||||||
|
# 修复:更新为新的配置格式
|
||||||
cat >"$CONFIG_DIR/config.json" <<EOF
|
cat >"$CONFIG_DIR/config.json" <<EOF
|
||||||
{
|
{
|
||||||
"log": {
|
"log": {
|
||||||
@@ -101,7 +104,14 @@ install_singbox() {
|
|||||||
"dns": {
|
"dns": {
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
"address": "tls://8.8.8.8"
|
"tag": "google-dns",
|
||||||
|
"address": "8.8.8.8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"outbound": "any",
|
||||||
|
"server": "google-dns"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -135,10 +145,19 @@ install_singbox() {
|
|||||||
],
|
],
|
||||||
"outbounds": [
|
"outbounds": [
|
||||||
{
|
{
|
||||||
"type": "direct"
|
"type": "direct",
|
||||||
|
"tag": "direct-out"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"route": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"inbound": "VLESSReality",
|
||||||
|
"outbound": "direct-out"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >"$STATE_FILE" <<EOF
|
cat >"$STATE_FILE" <<EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user