beta release fix
This commit is contained in:
@@ -4,13 +4,14 @@ import os
|
||||
import glob
|
||||
import shutil
|
||||
|
||||
SCRIPT_NAME = "systemd-hdtob.py"
|
||||
SCRIPT_NAME = "/usr/local/bin/systemd-hdtob.py"
|
||||
STATE_FILE = "/home/crime5/.timer/timer_state.txt"
|
||||
END_STATE = "/home/crime5/.timer/end_state.txt"
|
||||
|
||||
|
||||
def is_running():
|
||||
result = subprocess.run(["pgrep", "-f", SCRIPT_NAME], stdout=subprocess.PIPE)
|
||||
print(f"DEBUG: pgrep result: {result.returncode}, stdout: {result.stdout}")
|
||||
return result.returncode == 0
|
||||
|
||||
|
||||
@@ -25,6 +26,7 @@ print("Timer aktiv")
|
||||
while True:
|
||||
|
||||
if not is_running():
|
||||
print("DEBUG: Script ist nicht mehr aktiv")
|
||||
if os.path.exists(END_STATE):
|
||||
print("Du hast verloren – Timer ist abgelaufen!")
|
||||
print("Lösche /home/test/* ...")
|
||||
@@ -43,7 +45,9 @@ while True:
|
||||
print("Fertig.")
|
||||
exit(0)
|
||||
else:
|
||||
subprocess.run(["/root/win-message.sh"])
|
||||
print("DEBUG: Win message wird ausgeführt!")
|
||||
subprocess.run(["/usr/local/bin/win-message.sh"])
|
||||
time.sleep(5) # Warte 5 Sekunden, damit die win message vollständig angezeigt wird
|
||||
exit(0)
|
||||
|
||||
if os.path.exists(STATE_FILE):
|
||||
|
||||
Reference in New Issue
Block a user