This repository has been archived on 2025-05-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
pi-race-timer/app/utils/system_tools.py
2025-04-29 23:36:37 +02:00

14 lines
398 B
Python

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