init
This commit is contained in:
commit
ce1095bb24
27 changed files with 621 additions and 0 deletions
14
app/utils/system_tools.py
Normal file
14
app/utils/system_tools.py
Normal 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
|
||||
Reference in a new issue