~增加crash -d命令,可以更简洁的debug执行时的错误信息

~为padavan设备增加了启动服务后自动保存mtd的功能
~优化singbox配置文件覆写,增强对各种第三方配置文件的普适性
~当自动任务启用同步ntp服务时,不再启动singbox内置的ntp模块
~singbox内置ntp模块移除了指定出口以增强普适性,但效果有待观察
~适配singbox1.7.8版本的mix模式
~修复各种类型的找不到内核或者内核下载失败问题
~修复使用默认dns时singbox内核提示dns出错的bug
~修复sed -e报错
This commit is contained in:
juewuy
2024-02-03 22:19:04 +08:00
parent 5ec99ebcff
commit 318cca0716
8 changed files with 120 additions and 88 deletions

View File

@@ -1897,6 +1897,7 @@ case "$1" in
echo " -h 帮助列表"
echo " -u 卸载脚本"
echo " -i 初始化脚本"
echo " -d 测试运行"
echo -----------------------------------------
echo " crash -s start 启动服务"
echo " crash -s stop 停止服务"
@@ -1921,6 +1922,26 @@ case "$1" in
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
$shtype -x ${CRASHDIR}/start.sh $2 $3 $4 $5 $6
;;
-d)
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
echo -e "正在测试运行!如发现错误请截图后前往\033[32;4mt.me/ShellClash\033[0m咨询"
$shtype ${CRASHDIR}/start.sh debug >/dev/null 2>${TMPDIR}/sh_bug
$shtype -x ${CRASHDIR}/start.sh debug >/dev/null 2>${TMPDIR}/debug_sh.log
echo -----------------------------------------
if [ -s ${TMPDIR}/sh_bug ];then
while read line ;do
echo -e "发现错误:\033[33;4m$line\033[0m"
grep -A 1 -B 3 "$line" ${TMPDIR}/debug_sh.log
echo -----------------------------------------
done < ${TMPDIR}/sh_bug
rm -rf ${TMPDIR}/sh_bug
echo -e "\033[32m测试完成\033[0m完整执行记录请查看\033[36m${TMPDIR}/debug_sh.log\033[0m"
else
echo -e "\033[32m测试完成没有发现问题~\033[0m"
rm -rf ${TMPDIR}/debug_sh.log
fi
${CRASHDIR}/start.sh stop
;;
-u)
uninstall
;;