~优化测试相关命令

~优化版本回退功能,现在支持回退到近期tags
~修复保守模式停止服务时未正确注销防火墙的bug
~修复小米设备因安装在u盘等导致自启命令不正确的bug
This commit is contained in:
juewuy
2026-01-21 19:05:40 +08:00
parent f7f39af5e3
commit 56cb4a327f
4 changed files with 31 additions and 19 deletions

View File

@@ -72,9 +72,10 @@ stop)
cronset '运行时每'
cronset '流媒体预解析'
#多种方式结束进程
if [ -f "$TMPDIR/shellcrash.pid" ];then
kill -TERM "$(cat "$TMPDIR/shellcrash.pid")"
rm -f "$TMPDIR/shellcrash.pid"
if [ -f "$TMPDIR/shellcrash.pid" ];then
kill -TERM "$(cat "$TMPDIR/shellcrash.pid")"
rm -f "$TMPDIR/shellcrash.pid"
stop_firewall
elif [ "$USER" = "root" ] && grep -q 'systemd' /proc/1/comm; then
systemctl stop shellcrash.service >/dev/null 2>&1
elif [ -f /etc/rc.common ] && grep -q 'procd' /proc/1/comm; then
@@ -85,7 +86,7 @@ stop)
elif rc-status -r >/dev/null 2>&1; then
rc-service shellcrash stop >/dev/null 2>&1
else
stop_firewall #清理路由策略
stop_firewall
fi
killall CrashCore 2>/dev/null
#清理缓存目录
@@ -115,8 +116,8 @@ debug)
else
sed -i "s/log-level: info/log-level: $2/" "$TMPDIR"/config.yaml
fi
[ "$3" = flash ] && dir=$CRASHDIR || dir=$TMPDIR
$COMMAND >${dir}/debug.log 2>&1 &
[ "$3" = flash ] && dir="$CRASHDIR" || dir="$TMPDIR"
$COMMAND >"$dir"/debug.log 2>&1 &
sleep 2
logger "已运行debug模式!如需停止,请使用重启/停止服务功能!" 33
else