mirror of
https://github.com/akuker/RASCSI.git
synced 2024-10-27 18:26:18 +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
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def rascsi_service(action):
|
def systemd_service(service, action):
|
||||||
# start/stop/restart
|
# start/stop/restart
|
||||||
return (
|
return (
|
||||||
subprocess.run(["sudo", "/bin/systemctl", action, "rascsi.service"]).returncode
|
subprocess.run(["sudo", "/bin/systemctl", action, service]).returncode
|
||||||
== 0
|
== 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ from pi_cmds import (
|
|||||||
shutdown_pi,
|
shutdown_pi,
|
||||||
reboot_pi,
|
reboot_pi,
|
||||||
running_env,
|
running_env,
|
||||||
|
systemd_service,
|
||||||
running_netatalk,
|
running_netatalk,
|
||||||
rascsi_service,
|
|
||||||
is_bridge_setup,
|
is_bridge_setup,
|
||||||
disk_space,
|
disk_space,
|
||||||
)
|
)
|
||||||
@ -473,7 +473,8 @@ def rascsi_restart():
|
|||||||
detach_all()
|
detach_all()
|
||||||
flash("Safely detached all devices.")
|
flash("Safely detached all devices.")
|
||||||
flash("Restarting RaSCSI Service...")
|
flash("Restarting RaSCSI Service...")
|
||||||
rascsi_service("restart")
|
systemd_service("rascsi.service", "restart")
|
||||||
|
systemd_service("monitor_rascsi.service", "restart")
|
||||||
return redirect(url_for("index"))
|
return redirect(url_for("index"))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user