diff --git a/frontend/index.html b/frontend/index.html index 27b75bf..b5d681e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,6 +5,8 @@ Photobooth + + diff --git a/scripts/kiosk-session.sh b/scripts/kiosk-session.sh index 751bed0..4d911c0 100755 --- a/scripts/kiosk-session.sh +++ b/scripts/kiosk-session.sh @@ -1,4 +1,14 @@ #!/bin/bash + +# Verrou : une seule instance autorisée +LOCK=/tmp/photobooth-kiosk.lock +if [ -f "$LOCK" ] && kill -0 "$(cat $LOCK)" 2>/dev/null; then + echo "[kiosk] Déjà en cours (pid $(cat $LOCK)), abandon." + exit 0 +fi +echo $$ > "$LOCK" +trap "rm -f $LOCK" EXIT + xset s off xset -dpms xset s noblank @@ -15,14 +25,13 @@ _backend_loop() { } _backend_loop & -# Attendre que le backend soit prêt +# Attendre que le backend soit prêt (max 15s) for i in $(seq 1 15); do curl -sf http://localhost/ > /dev/null 2>&1 && break sleep 1 done -# Chromium en boucle : redémarre automatiquement s'il plante ou se ferme -# Attend si la photostation est en cours d'exécution +# Chromium en boucle : redémarre s'il plante, attend si photostation active while true; do while [ -f /tmp/photostation_running ]; do sleep 1; done chromium \