mirror of
https://github.com/kxgx/2.13-Ink-screen-clock.git
synced 2026-03-15 07:03:16 +08:00
更新 clean.sh
This commit is contained in:
12
bin/clean.sh
12
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 &
|
||||
|
||||
Reference in New Issue
Block a user