Update and rename stop.sh to e-Paper_clean.service

This commit is contained in:
星光-k
2025-01-10 21:44:38 +08:00
committed by GitHub
parent fa08cb3e85
commit 562a63cbc4
2 changed files with 14 additions and 7 deletions

14
bin/e-Paper_clean.service Normal file
View File

@@ -0,0 +1,14 @@
[Unit]
Description=Run e-Paper clean on shutdown and reboot
DefaultDependencies=no
Before=shutdown.target
Before=reboot.target
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /path/to/your/script/main.py
RemainAfterExit=yes
[Install]
WantedBy=shutdown.target
WantedBy=reboot.target

View File

@@ -1,7 +0,0 @@
#!/bin/bash
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
pid=`ps -ef |grep $dir/main.py | grep -v grep |awk '{print $2}'`
for id in $pid
do
kill -9 $id
done