From c3666059ce9ad1d0c574f63c06a95361f3504840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Mon, 20 Jan 2025 23:16:51 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20clean.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/clean.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/clean.sh b/bin/clean.sh index 0f1408d..8dd6092 100644 --- a/bin/clean.sh +++ b/bin/clean.sh @@ -4,8 +4,7 @@ f_name="clean.py" dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) logdir="${dir%/*}/log" service_name="raspi_e-Paper.service" -hold_time_seconds=5 # 设置维持时间,例如300秒(5分钟) - + # 停止raspi_e-Paper服务 echo "正在停止$service_name服务..." sudo systemctl stop "$service_name" @@ -19,9 +18,6 @@ if [ -n "$pids" ]; then kill -9 $pids fi -# 使用nohup在后台运行Python脚本,并将输出重定向到日志文件 -nohup /usr/bin/python3 -u "$dir/$f_name" > "${logdir}/info-clean.log" 2>&1 & - -# 等待维持时间 -echo "正在运行脚本,将在 ${hold_time_seconds} 秒后停止服务..." -sleep $hold_time_seconds +echo "正在清除屏幕内容" +# 运行Python脚本,并将输出重定向到日志文件 +/usr/bin/python3 -u "$dir/$f_name" > "${logdir}/info-clean.log" 2>&1 &