fix: optimize mixed-port value resolution to fix #275

This commit is contained in:
libm committed 2025-09-24 10:46:36 +08:00
1 parent 488aaf62e2
commit 5e44dfda05
2 files changed
+3 -2

No files matched your search

+2
View File
@@ -2,6 +2,8 @@
system-proxy:
enable: true
mixed-port: 7890
# Web 控制台配置
external-controller: "0.0.0.0:9090"
external-ui: public
+1 -2
View File
@@ -134,8 +134,7 @@ _get_random_port() {
}
function _get_proxy_port() {
local mixed_port=$(sudo "$BIN_YQ" '.mixed-port // ""' $CLASH_CONFIG_RUNTIME)
MIXED_PORT=${mixed_port:-7890}
MIXED_PORT=$(sudo "$BIN_YQ" '.mixed-port' $CLASH_CONFIG_RUNTIME)
_is_already_in_use "$MIXED_PORT" "$BIN_KERNEL_NAME" && {
local newPort=$(_get_random_port)