Added trap exit to kill the python process

This commit is contained in:
Raphaël Numbus
2026-03-29 12:30:38 +02:00
parent 9f5d91e510
commit c42c288c62
+7 -1
View File
@@ -11,7 +11,7 @@ launch_configurator() {
echo -e "\n 🚀 Launching Numbus Configurator..."
python3 "${BRIDGE_SCRIPT}" > /dev/null 2>&1 &
BRIDGE_PID=$!
export BRIDGE_PID=$!
echo -e "\n ➡️ Open your browser at: $(gum style --foreground 212 "http://localhost:${PORT}")"
xdg-open "http://localhost:${PORT}" 2>/dev/null || open "http://localhost:${PORT}" 2>/dev/null || true
@@ -737,6 +737,10 @@ nix_update() {
--use-remote-sudo switch --flake configuration/etc/nixos#numbus-server
}
cleanup() {
kill ${BRIDGE_PID}
}
set -euo pipefail
clear
@@ -763,6 +767,8 @@ echo "
sleep 1
trap cleanup EXIT
# --- MAIN ORCHESTRATION LOOP ---
# 0. TESTING ONLY