From 4a2db9c4815a9f477f52ae7a85d0eb52e522a6a6 Mon Sep 17 00:00:00 2001 From: juewuy Date: Wed, 7 Feb 2024 13:08:57 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BC=98=E5=8C=96=E5=B0=8F=E9=97=AA=E5=AD=98?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=8D=A0=E7=94=A8=20~=E4=B8=BAsingboxp?= =?UTF-8?q?=E5=86=85=E6=A0=B8=E5=85=A5=E7=AB=99=E6=B7=BB=E5=8A=A0always=5F?= =?UTF-8?q?resolve=5Fudp=E9=80=82=E9=85=8D=20~dns=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=8F=8A=E5=90=AF=E5=8A=A8=E6=8F=90=E7=A4=BA=E6=96=87=E5=AD=97?= =?UTF-8?q?=E8=B0=83=E6=95=B4=20~=E5=86=85=E6=A0=B8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=20~=E4=BF=AE=E5=A4=8D=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=B6=E6=A3=80=E6=B5=8B=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=9A=E9=99=B7=E5=85=A5=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/getdate.sh | 12 +++++++----- scripts/menu.sh | 7 ++++--- scripts/start.sh | 9 ++++++--- scripts/task.sh | 1 + 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 86c4254..62b4d8a 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -901,6 +901,7 @@ getcore(){ #下载内核文件 [ -n "$(pidof CrashCore)" ] && ${CRASHDIR}/start.sh stop #停止内核服务防止内存不足 [ -f ${TMPDIR}/core_new.tar.gz ] && { mkdir -p ${TMPDIR}/core_tmp + [ "$BINDIR" = "$TMPDIR" ] && rm -rf ${TMPDIR}/CrashCore #小闪存模式防止空间不足 tar -zxf "${TMPDIR}/core_new.tar.gz" ${tar_para} -C ${TMPDIR}/core_tmp/ for file in $(find ${TMPDIR}/core_tmp 2>/dev/null);do [ -f $file ] && [ -n "$(echo $file | sed 's#.*/##' | grep -iE '(CrashCore|sing|meta|mihomo|clash|premium)')" ] && mv -f $file ${TMPDIR}/core_new @@ -1077,16 +1078,16 @@ setcore(){ #内核选择菜单 echo -e "\033[36m如需本地上传,请将二进制文件上传至 /tmp 目录后重新运行crash命令\033[0m" echo ----------------------------------------------- echo -e "1 \033[43;30m Clash \033[0m: \033[32m占用低\033[0m" - echo -e " (开源基础内核) \033[33m不支持Tun、Rule-set等\033[0m" + echo -e " >>\033[32m$clash_v \033[33m不支持Tun、Rule-set等\033[0m" echo -e " 说明文档: \033[36;4mhttps://lancellc.gitbook.io\033[0m" echo -e "2 \033[43;30m SingBox \033[0m: \033[32m支持全面占用低\033[0m" - echo -e " (sing-box主干) \033[33m不支持providers\033[0m" + echo -e " >>\033[32m$singbox_v \033[33m不支持providers\033[0m" echo -e " 说明文档: \033[36;4mhttps://sing-box.sagernet.org\033[0m" echo -e "3 \033[43;30m Mihomo \033[0m: \033[32m多功能,支持全面\033[0m" - echo -e " (Meta/Mihomo) \033[33m内存占用较高\033[0m" + echo -e " >>\033[32m$meta_v \033[33m内存占用较高\033[0m" echo -e " 说明文档: \033[36;4mhttps://wiki.metacubex.one\033[0m" echo -e "4 \033[43;30m SingBoxP \033[0m: \033[32m支持ssr、providers、dns并发……\033[0m" - echo -e " (sing-box分支) \033[33mPuerNya分支版本\033[0m" + echo -e " >>\033[32m$singboxp_v \033[33mPuerNya分支版本\033[0m" echo -e " 说明文档: \033[36;4mhttps://sing-box.sagernet.org\033[0m" echo ----------------------------------------------- echo -e "5 \033[36m自定义内核\033[0m $custcore" @@ -1599,6 +1600,7 @@ setserver(){ read -p "请输入对应字母或数字 > " num case $num in 0) + checkupdate=false ;; [1-99]) url_id_new=$(grep -E "^1|$release_name" ${CRASHDIR}/configs/servers.list | sed -n ""$num"p" | awk '{print $1}') @@ -1703,7 +1705,7 @@ checkupdate(){ else echo -e "\033[31m检查更新失败!请尝试切换其他安装源!\033[0m" setserver - checkupdate + [ "$checkupdate" = false ] || checkupdate fi rm -rf ${TMPDIR}/version_new } diff --git a/scripts/menu.sh b/scripts/menu.sh index cd1e0eb..a28a780 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -159,7 +159,7 @@ errornum(){ echo -e "\033[31m请输入正确的字母或数字!\033[0m" } startover(){ - echo -e "\033[32m$corename服务已启动!\033[0m" + echo -e "\033[32m服务已启动!\033[0m" echo -e "请使用 \033[4;36mhttp://$host$hostdir\033[0m 管理内置规则" if [ "$redir_mod" = "纯净模式" ];then echo ----------------------------------------------- @@ -1204,6 +1204,7 @@ normal_set(){ #基础设置 } set_dns_mod(){ + [ "$dns_mod" = mix ] && [ "$crashcore" != singbox -o "$crashcore" != singboxp ] && dns_mod=redir_host echo ----------------------------------------------- echo -e "当前DNS运行模式为:\033[47;30m $dns_mod \033[0m" echo -e "\033[33m切换模式后需要手动重启服务以生效!\033[0m" @@ -1213,7 +1214,7 @@ normal_set(){ #基础设置 echo -e " 2 redir_host模式:\033[32m兼容性更好\033[0m" echo -e " 需搭配加密DNS使用" echo -e " 3 mix混合模式: \033[32m内部realip外部fakeip\033[0m" - echo -e " 限singbox1.8.0+内核!" + echo -e " 依赖geosite-cn.(db/srs)数据库" echo " 0 返回上级菜单" read -p "请输入对应数字 > " num if [ -z "$num" ]; then @@ -1232,7 +1233,7 @@ normal_set(){ #基础设置 echo ----------------------------------------------- echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m" elif [ "$num" = 3 ]; then - if [ "$crashcore" = singbox -o "$crashcore" = singboxp ] && [ "$core_v" != '1.7.8' ];then + if [ "$crashcore" = singbox -o "$crashcore" = singboxp ];then dns_mod=mix setconfig dns_mod $dns_mod echo ----------------------------------------------- diff --git a/scripts/start.sh b/scripts/start.sh index 2435245..a51f6d5 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -672,10 +672,10 @@ EOF [ -n "$authentication" ] && { username=$(echo $authentication | awk -F ':' '{print $1}') #混合端口账号密码 password=$(echo $authentication | awk -F ':' '{print $2}') - userpass=', "users": [{ "username": "'$username'", "password": "'$password'" }]' + userpass='"users": [{ "username": "'$username'", "password": "'$password'" }], ' } [ "$sniffer" = "已启用" ] && sniffer=true || sniffer=false #域名嗅探配置 - + [ "$crashcore" = singboxp ] && always_resolve_udp='"always_resolve_udp": true,' cat > ${TMPDIR}/jsons/inbounds.json </dev/null);do [ -f $file ] && [ -n "$(echo $file | sed 's#.*/##' | grep -iE '(CrashCore|sing|meta|mihomo|clash|premium)')" ] && mv -f $file ${TMPDIR}/core_new