From 9bd0b9802b4fc6d46b3d9d6292ed22e7418da328 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Wed, 13 Oct 2021 17:55:25 -0700 Subject: [PATCH] Detach all devices when shutting down/restarting (#323) * Detach all before shutting down / restarting * Additional message --- src/web/web.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/web/web.py b/src/web/web.py index 7adb2700..d5c7b4bf 100644 --- a/src/web/web.py +++ b/src/web/web.py @@ -448,20 +448,26 @@ def device_info(): @app.route("/pi/reboot", methods=["POST"]) def restart(): - flash("Restarting the Pi momentarily...") + detach_all() + flash("Safely detached all devices.") + flash("Rebooting the Pi momentarily...") reboot_pi() return redirect(url_for("index")) @app.route("/rascsi/restart", methods=["POST"]) def rascsi_restart(): - rascsi_service("restart") + detach_all() + flash("Safely detached all devices.") flash("Restarting RaSCSI Service...") + rascsi_service("restart") return redirect(url_for("index")) @app.route("/pi/shutdown", methods=["POST"]) def shutdown(): + detach_all() + flash("Safely detached all devices.") flash("Shutting down the Pi momentarily...") shutdown_pi() return redirect(url_for("index"))