mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 19:46:52 +03:00
Fix: remove duplicate function sing_box_config_outbound_json
This commit is contained in:
@@ -857,7 +857,6 @@ sing_box_config_outbound_json() {
|
||||
local json_config="$1"
|
||||
local listen_port="$2"
|
||||
|
||||
# Create temporary file with base config structure
|
||||
cat > /tmp/base_config.json << EOF
|
||||
{
|
||||
"log": {
|
||||
@@ -878,10 +877,7 @@ sing_box_config_outbound_json() {
|
||||
}
|
||||
EOF
|
||||
|
||||
# Add the outbound config using jq
|
||||
jq --argjson outbound "$json_config" '.outbounds += [$outbound]' /tmp/base_config.json > /etc/sing-box/config.json
|
||||
|
||||
# Cleanup
|
||||
rm -f /tmp/base_config.json
|
||||
}
|
||||
|
||||
@@ -1096,34 +1092,6 @@ EOF
|
||||
rm -f /tmp/vless_temp.json
|
||||
}
|
||||
|
||||
sing_box_config_outbound_json() {
|
||||
local json_config="$1"
|
||||
local listen_port="$2"
|
||||
|
||||
cat > /tmp/base_config.json << EOF
|
||||
{
|
||||
"log": {
|
||||
"level": "warn"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "tproxy",
|
||||
"listen": "::",
|
||||
"listen_port": $listen_port,
|
||||
"sniff": false
|
||||
}
|
||||
],
|
||||
"outbounds": [],
|
||||
"route": {
|
||||
"auto_detect_interface": true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
jq --argjson outbound "$json_config" '.outbounds += [$outbound]' /tmp/base_config.json > /etc/sing-box/config.json
|
||||
rm -f /tmp/base_config.json
|
||||
}
|
||||
|
||||
sing_box_config_check() {
|
||||
if ! sing-box -c /etc/sing-box/config.json check >/dev/null 2>&1; then
|
||||
log "Sing-box configuration is invalid"
|
||||
|
||||
Reference in New Issue
Block a user