14 lines
398 B
Python
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
|