mirror of
https://github.com/akuker/RASCSI.git
synced 2024-08-21 04:29:39 +00:00
Restart monitor_rascsi from the Web UI (#341)
This commit is contained in:
parent
1cae11bcac
commit
8ab16a1fb2
@ -1,10 +1,10 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
def rascsi_service(action):
|
||||
def systemd_service(service, action):
|
||||
# start/stop/restart
|
||||
return (
|
||||
subprocess.run(["sudo", "/bin/systemctl", action, "rascsi.service"]).returncode
|
||||
subprocess.run(["sudo", "/bin/systemctl", action, service]).returncode
|
||||
== 0
|
||||
)
|
||||
|
||||
|
@ -29,8 +29,8 @@ from pi_cmds import (
|
||||
shutdown_pi,
|
||||
reboot_pi,
|
||||
running_env,
|
||||
systemd_service,
|
||||
running_netatalk,
|
||||
rascsi_service,
|
||||
is_bridge_setup,
|
||||
disk_space,
|
||||
)
|
||||
@ -473,7 +473,8 @@ def rascsi_restart():
|
||||
detach_all()
|
||||
flash("Safely detached all devices.")
|
||||
flash("Restarting RaSCSI Service...")
|
||||
rascsi_service("restart")
|
||||
systemd_service("rascsi.service", "restart")
|
||||
systemd_service("monitor_rascsi.service", "restart")
|
||||
return redirect(url_for("index"))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user