diff --git a/bin/ShellCrash.tar.gz b/bin/ShellCrash.tar.gz index 89b67a9..fd2463c 100644 Binary files a/bin/ShellCrash.tar.gz and b/bin/ShellCrash.tar.gz differ diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 731a781..be39b34 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/public.tar.gz b/bin/public.tar.gz index 1822fac..7b417c3 100644 Binary files a/bin/public.tar.gz and b/bin/public.tar.gz differ diff --git a/bin/version b/bin/version index e975712..0f348e9 100644 --- a/bin/version +++ b/bin/version @@ -5,4 +5,4 @@ meta_v=v1.18.0 singbox_v=1.7.8 GeoIP_v=20240120 -versionsh=1.8.8d +versionsh=1.8.8e diff --git a/scripts/init.sh b/scripts/init.sh index a748f4d..a86da9d 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,7 +1,7 @@ #!/bin/sh # Copyright (C) Juewuy -version=1.8.8d +version=1.8.8e setdir(){ dir_avail(){ diff --git a/scripts/menu.sh b/scripts/menu.sh index 92a06e9..ee61c29 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -1371,7 +1371,6 @@ normal_set(){ #基础设置 local_proxy=未开启 setconfig local_proxy $local_proxy setconfig local_type - [ -w /etc/init.d/shellcrash ] && sed -i 's/procd_set_param user shellcrash/procd_set_param user root/' /etc/init.d/shellcrash echo -e "\033[33m已经停用本机代理规则,请尽快重启服务!!\033[0m" fi sleep 1 diff --git a/scripts/shellcrash.procd b/scripts/shellcrash.procd index f155d84..9c393f1 100644 --- a/scripts/shellcrash.procd +++ b/scripts/shellcrash.procd @@ -13,10 +13,12 @@ source ${CRASHDIR}/configs/command.env #加载启动命令和启动目录 start_service() { #检测必须文件 $CRASHDIR/start.sh bfstart + #本机代理用户 + [ -n "$(grep -E 'local_type.*增强模式' ${CRASHDIR}/configs/ShellCrash.cfg)" ] && USER=shellcrash || USER=root if [ "$?" = "0" ];then #使用procd创建clash后台进程 procd_open_instance - procd_set_param user root + procd_set_param user $USER procd_set_param respawn procd_set_param command $COMMAND procd_set_param stderr 0 diff --git a/scripts/start.sh b/scripts/start.sh index 65b6045..003d6b4 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -163,12 +163,13 @@ mark_time(){ #时间戳 } getlanip(){ #获取局域网host地址 i=1 - while [ "$i" -le "10" ];do + while [ "$i" -le "20" ];do host_ipv4=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'br' | grep -Ev 'iot' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/br.*$//g' | sed 's/metric.*$//g' ) #ipv4局域网网段 [ "$ipv6_redir" = "已开启" ] && host_ipv6=$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g' ) #ipv6公网地址段 [ -f ${TMPDIR}/ShellCrash.log ] && break + [ -n "$host_ipv4" -a "$ipv6_redir" != "已开启" ] && break [ -n "$host_ipv4" -a -n "$host_ipv6" ] && break - sleep 2 && i=$((i+1)) + sleep 1 && i=$((i+1)) done #添加自定义ipv4局域网网段 host_ipv4="$host_ipv4$cust_host_ipv4" @@ -1548,8 +1549,6 @@ bfstart(){ #启动前 echo "shellcrash:x:0:7890:::" >> /etc/passwd fi fi - #修改procd启动文件 - [ "$start_old" != "已开启" -a -w /etc/init.d/shellcrash ] && sed -i 's/procd_set_param user root/procd_set_param user shellcrash/' /etc/init.d/shellcrash fi #清理debug日志 rm -rf ${TMPDIR}/debug.log