feat: Add POST /stop route to kill VNC
This commit is contained in:
parent
16bf0fe61a
commit
a2ae0d22ae
6
main.py
6
main.py
|
@ -27,6 +27,12 @@ def cast_spell():
|
||||||
logging.warning(f"Invalid or missing machine parameter: {machine}")
|
logging.warning(f"Invalid or missing machine parameter: {machine}")
|
||||||
return f"Invalid or missing 'machine' parameter. Use 'trotec' or 'thunder'.", 400
|
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():
|
def cast_trotec():
|
||||||
"""Executes the xtightvncviewer command."""
|
"""Executes the xtightvncviewer command."""
|
||||||
command = "DISPLAY=:1 xtightvncviewer -viewonly -fullscreen 172.17.17.214"
|
command = "DISPLAY=:1 xtightvncviewer -viewonly -fullscreen 172.17.17.214"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user