This commit is contained in:
Rainer 2025-04-29 23:36:37 +02:00
commit ce1095bb24
27 changed files with 621 additions and 0 deletions

14
app/utils/system_tools.py Normal file
View file

@ -0,0 +1,14 @@
import subprocess
def reboot():
subprocess.run(["sudo", "reboot"])
def shutdown():
subprocess.run(["sudo", "shutdown", "now"])
def restart_service():
subprocess.run(["sudo", "systemctl", "restart", "rennstopuhr.service"])
def get_logs():
result = subprocess.run(["journalctl", "-u", "rennstopuhr.service", "--no-pager"], capture_output=True, text=True)
return result.stdout