Merge branch 'master' into dev

This commit is contained in:
juewuy
2026-10-24 18:23:26 +08:00
16 changed files with 57 additions and 30 deletions
+1
View File
@@ -1,6 +1,7 @@
. "$CRASHDIR"/libs/check_target.sh
. "$CRASHDIR"/libs/core_tools.sh
. "$CRASHDIR"/configs/directories.env
. "$CRASHDIR"/configs/command.env
check_core() { #检查及下载内核文件
+4 -1
View File
@@ -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
}
}
}
+4
View File
@@ -136,6 +136,10 @@ split_and_customize_yaml_parts() {
yaml_char='proxies proxy-groups proxy-providers rules rule-providers sub-rules listeners'
for char in $yaml_char; do
sed -n "/^$char:/,/^[a-z]/ { /^[a-z]/d; p; }" $core_config >"$TMPDIR"/${char}.yaml
#支持 Clash 常见的单行 flow-style 节点列表,例如 proxies: [{name: ..., type: ...}]
if [ "$char" = proxies ] && [ ! -s "$TMPDIR"/proxies.yaml ]; then
sed -n 's/^proxies:[[:space:]]*\[\(.*\)\][[:space:]]*$/ - \1/p' "$core_config" >"$TMPDIR"/proxies.yaml
fi
done
#跳过本地tls证书验证
[ "$skip_cert" != "OFF" ] && sed -i 's/skip-cert-verify: false/skip-cert-verify: true/' "$TMPDIR"/proxies.yaml ||
+2 -1
View File
@@ -6,7 +6,8 @@ description="Custom proxy service for ShellCrash"
#获取目录
CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
[ -z "$CRASHDIR" ] && CRASHDIR=$(cat ~/.bashrc | grep CRASHDIR | awk -F "\"" '{print $2}')
. ${CRASHDIR}/configs/command.env #加载启动命令和启动目录
. "${CRASHDIR}"/configs/directories.env #加载启动目录
. "${CRASHDIR}"/configs/command.env #加载启动命令
# PID 文件
pidfile="/run/shellcrash.pid"
+2 -1
View File
@@ -8,7 +8,8 @@ USE_PROCD=1
#获取目录
CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
[ -z "$CRASHDIR" ] && CRASHDIR=$(cat ~/.bashrc | grep CRASHDIR | awk -F "\"" '{print $2}')
. "$CRASHDIR"/configs/command.env #加载启动命令和启动目录
. "$CRASHDIR"/configs/directories.env #加载启动目录
. "$CRASHDIR"/configs/command.env #加载启动命令
start_service() {
if [ -n "$(cat $CRASHDIR/configs/ShellCrash.cfg | grep 'firewall_area=5')" ]; then