mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-25 03:32:16 +00:00
Detach all devices when shutting down/restarting (#323)
* Detach all before shutting down / restarting * Additional message
This commit is contained in:
parent
fa12f49078
commit
9bd0b9802b
@ -448,20 +448,26 @@ def device_info():
|
|||||||
|
|
||||||
@app.route("/pi/reboot", methods=["POST"])
|
@app.route("/pi/reboot", methods=["POST"])
|
||||||
def restart():
|
def restart():
|
||||||
flash("Restarting the Pi momentarily...")
|
detach_all()
|
||||||
|
flash("Safely detached all devices.")
|
||||||
|
flash("Rebooting the Pi momentarily...")
|
||||||
reboot_pi()
|
reboot_pi()
|
||||||
return redirect(url_for("index"))
|
return redirect(url_for("index"))
|
||||||
|
|
||||||
|
|
||||||
@app.route("/rascsi/restart", methods=["POST"])
|
@app.route("/rascsi/restart", methods=["POST"])
|
||||||
def rascsi_restart():
|
def rascsi_restart():
|
||||||
rascsi_service("restart")
|
detach_all()
|
||||||
|
flash("Safely detached all devices.")
|
||||||
flash("Restarting RaSCSI Service...")
|
flash("Restarting RaSCSI Service...")
|
||||||
|
rascsi_service("restart")
|
||||||
return redirect(url_for("index"))
|
return redirect(url_for("index"))
|
||||||
|
|
||||||
|
|
||||||
@app.route("/pi/shutdown", methods=["POST"])
|
@app.route("/pi/shutdown", methods=["POST"])
|
||||||
def shutdown():
|
def shutdown():
|
||||||
|
detach_all()
|
||||||
|
flash("Safely detached all devices.")
|
||||||
flash("Shutting down the Pi momentarily...")
|
flash("Shutting down the Pi momentarily...")
|
||||||
shutdown_pi()
|
shutdown_pi()
|
||||||
return redirect(url_for("index"))
|
return redirect(url_for("index"))
|
||||||
|
Loading…
Reference in New Issue
Block a user