Added trap exit to kill the python process
This commit is contained in:
@@ -11,7 +11,7 @@ launch_configurator() {
|
|||||||
|
|
||||||
echo -e "\n 🚀 Launching Numbus Configurator..."
|
echo -e "\n 🚀 Launching Numbus Configurator..."
|
||||||
python3 "${BRIDGE_SCRIPT}" > /dev/null 2>&1 &
|
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}")"
|
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
|
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
|
--use-remote-sudo switch --flake configuration/etc/nixos#numbus-server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
kill ${BRIDGE_PID}
|
||||||
|
}
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
clear
|
clear
|
||||||
@@ -763,6 +767,8 @@ echo "
|
|||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
# --- MAIN ORCHESTRATION LOOP ---
|
# --- MAIN ORCHESTRATION LOOP ---
|
||||||
|
|
||||||
# 0. TESTING ONLY
|
# 0. TESTING ONLY
|
||||||
|
|||||||
Reference in New Issue
Block a user