From 5e58823ceec9f84bf61663e40383ada949b9c15f Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 26 Jan 2026 19:08:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?~=E4=BC=98=E5=8C=96=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/libs/set_config.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/libs/set_config.sh b/scripts/libs/set_config.sh index c0e0d82f..c1cf3e7d 100644 --- a/scripts/libs/set_config.sh +++ b/scripts/libs/set_config.sh @@ -1,9 +1,6 @@ #参数1代表变量名,参数2代表变量值,参数3即文件路径 setconfig() { [ -z "$3" ] && configpath="$CRASHDIR"/configs/ShellCrash.cfg || configpath="${3}" - if grep -q "^${1}=" "$configpath"; then - sed -i "s#^${1}=.*#${1}=${2}#g" "$configpath" - else - printf '%s=%s\n' "$1" "$2" >>"$configpath" - fi + sed -i "/^${1}=.*/d" "$configpath" + printf '%s=%s\n' "$1" "$2" >>"$configpath" } \ No newline at end of file From d2d25a60eb7da42110cb862c3d990d6f6a1c5308 Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 26 Jan 2026 19:13:53 +0800 Subject: [PATCH 2/3] ~bug fix --- scripts/menu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/menu.sh b/scripts/menu.sh index 38cadd9f..62d228a5 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -101,7 +101,7 @@ ckstatus() { #脚本启动前检查 #检查执行权限 [ ! -x "$CRASHDIR"/start.sh ] && chmod +x "$CRASHDIR"/start.sh #检查/tmp内核文件 - for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box|meta.*'); do + for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box'); do echo -e "发现可用的内核文件: \033[36m/tmp/$file\033[0m " read -p "是否加载(会停止当前服务)?(1/0) > " res [ "$res" = 1 ] && { From 6d904eb297be4f44788f538ad703293edbfed6a9 Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 26 Jan 2026 19:18:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?~=E4=BF=AE=E5=A4=8DWireguard=E7=BD=91?= =?UTF-8?q?=E6=AE=B5=E4=BC=9A=E8=A2=AB=E5=85=AC=E7=BD=91=E9=98=B2=E7=81=AB?= =?UTF-8?q?=E5=A2=99=E6=8B=A6=E6=88=AA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/starts/fw_getlanip.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/starts/fw_getlanip.sh b/scripts/starts/fw_getlanip.sh index e4ad6c27..2849bcbe 100644 --- a/scripts/starts/fw_getlanip.sh +++ b/scripts/starts/fw_getlanip.sh @@ -9,23 +9,29 @@ getlanip() { #获取局域网host地址 [ -n "$host_ipv4" -a -n "$host_ipv6" ] && break sleep 1 && i=$((i + 1)) done - #tailscale + #Tailscale [ "$ts_service" = ON ] && { ts_host_ipv4=' 100.64.0.0/10' ts_host_ipv6=' fd7a:115c:a1e0::/48' } + #Wireguard + [ "$wg_service" = ON ] && { + . "$CRASHDIR"/configs/gateway.cfg + wg_host_ipv4=' $wg_ipv4' + [ -n "$wg_ipv6" ] && wg_host_ipv6=' $wg_ipv6' + } #添加自定义ipv4局域网网段 if [ "$replace_default_host_ipv4" == "ON" ]; then host_ipv4="$cust_host_ipv4" else - host_ipv4=$(echo $host_ipv4 $cust_host_ipv4$ts_host_ipv4| tr '\n' ' ' | sed 's/ $//') + host_ipv4=$(echo "$host_ipv4 $cust_host_ipv4$ts_host_ipv4$wg_host_ipv4"| tr '\n' ' ' | sed 's/ $//') fi #缺省配置 [ -z "$host_ipv4" ] && { host_ipv4='192.168.0.0/16 10.0.0.0/12 172.16.0.0/12' logger "无法获取本地LAN-IPV4网段,请前往流量过滤设置界面设置自定义网段!" 31 } - host_ipv6="fe80::/10 fd00::/8 $host_ipv6$ts_host_ipv6" + host_ipv6="fe80::/10 fd00::/8 $host_ipv6$ts_host_ipv6$wg_host_ipv6" #获取本机出口IP地址 local_ipv4=$(ip route 2>&1 | grep -Ev 'utun|iot|docker|linkdown' | grep -Eo 'src.*' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u) [ -z "$local_ipv4" ] && local_ipv4=$(ip route 2>&1 | grep -Eo 'src.*' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u)