From bdc0b0d68af4b7874312ae13e4387e93dd7f6e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20MARQUET?= Date: Fri, 29 Mar 2024 10:50:17 +0100 Subject: [PATCH] Init --- startup.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 startup.sh diff --git a/startup.sh b/startup.sh new file mode 100644 index 0000000..5ad402b --- /dev/null +++ b/startup.sh @@ -0,0 +1,41 @@ +#/bin/bash +# Bash script for start up all the programs for SERGE +# All programs are started in the background and in parallel +# All the programs are called with their needed arguments +# Author: Félix MARQUET + +# Fonction pour surveiller la fermeture de l'IHM +monitor_ihm() { + while pgrep -x "ihm" > /dev/null; do + sleep 1 + done + # Une fois l'IHM fermée, tuer tous les autres programmes + killall tcp-server + killall lidar + killall camera + echo "All programs terminated." +} + +# Démarrer la fonction de surveillance en arrière-plan +monitor_ihm & + +# Démarrer le serveur TCP +echo "Starting the TCP server" +/home/modelec/serge/tcp-server & +sleep 1 + +# Démarrer le Lidar +echo "Starting the Lidar" +/home/modelec/serge/lidar & +sleep 1 + +# Démarrer la caméra +echo "Starting the camera" +/home/modelec/serge/camera & + +# Démarrer l'IHM +echo "Starting the IHM" +/home/modelec/serge/ihm fullscreen & + +# Attendre que tous les programmes se terminent +wait