fix: optimize valid mixin config.

This commit is contained in:
libm committed 2025-04-07 21:33:20 +08:00
1 parent 05e1406ddb
commit 6b312ec600
2 files changed
+9 -3

No files matched your search

+8 -2
View File
@@ -77,8 +77,14 @@ function clashui() {
}
_merge_config_restart() {
_valid_config "$CLASH_CONFIG_MIXIN" || _error_quit "验证失败:请检查 Mixin 配置"
sudo "$BIN_YQ" -n "load(\"$CLASH_CONFIG_RAW\") * load(\"$CLASH_CONFIG_MIXIN\")" | sudo tee "$CLASH_CONFIG_RUNTIME" >&/dev/null && clashrestart
local backup="/tmp/rt.backup"
sudo cat "$CLASH_CONFIG_RUNTIME" 2>/dev/null | sudo tee $backup >&/dev/null
sudo "$BIN_YQ" -n "load(\"$CLASH_CONFIG_RAW\") * load(\"$CLASH_CONFIG_MIXIN\")" | sudo tee "$CLASH_CONFIG_RUNTIME" >&/dev/null
_valid_config "$CLASH_CONFIG_RUNTIME" || {
sudo cat $backup | sudo tee "$CLASH_CONFIG_RUNTIME" >&/dev/null
_error_quit "验证失败:请检查 Mixin 配置"
}
clashrestart
}
function clashsecret() {
+1 -1
View File
@@ -188,7 +188,7 @@ function _error_quit() {
local msg="${emoji} $1"
_get_color_msg "$color" "$msg"
}
_quit
exit >&/dev/null
}
_is_bind() {