mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-10-24 20:00:01 +00:00
~修复proxies只有一行时无法正确生成配置文件的bug
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
check_config() { #检查clash配置文件
|
||||
#检测节点或providers
|
||||
sed -n "/^proxies:/,/^[a-z]/ { /^[a-z]/d; p; }" "$core_config_new" >"$TMPDIR"/proxies.yaml
|
||||
if [ ! -s "$TMPDIR"/proxies.yaml ]; then
|
||||
sed -n 's/^proxies:[[:space:]]*\[\(.*\)\][[:space:]]*$/ - \1/p' "$core_config_new" >"$TMPDIR"/proxies.yaml
|
||||
fi
|
||||
if ! grep -Eq 'server:|server":|server'\'':' "$TMPDIR"/proxies.yaml && ! grep -q 'proxy-providers:' "$core_config_new"; then
|
||||
echo "-----------------------------------------------"
|
||||
logger "获取到了配置文件【$core_config_new】,但似乎并不包含正确的节点信息!" 31
|
||||
@@ -38,4 +41,4 @@ check_config() { #检查clash配置文件
|
||||
done <"$TMPDIR"/clash_proxies
|
||||
rm -rf "$TMPDIR"/clash_proxies
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user