From a2ae0d22ae6349bdac92693a952f45b9b479aa90 Mon Sep 17 00:00:00 2001 From: "Tanner Collin (aider)" Date: Tue, 17 Jun 2025 19:27:06 -0600 Subject: [PATCH] feat: Add POST /stop route to kill VNC --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index 67976c1..f989d0d 100644 --- a/main.py +++ b/main.py @@ -27,6 +27,12 @@ def cast_spell(): logging.warning(f"Invalid or missing machine parameter: {machine}") return f"Invalid or missing 'machine' parameter. Use 'trotec' or 'thunder'.", 400 +@app.route('/stop', methods=['POST']) +def stop_cast(): + logging.info("Received POST request on /stop.") + kill_vnc() + return "Attempted to stop VNC viewers.", 200 + def cast_trotec(): """Executes the xtightvncviewer command.""" command = "DISPLAY=:1 xtightvncviewer -viewonly -fullscreen 172.17.17.214"