pour démarrer un script quand sympa est up. doit-être démarré au boot de la machine
This commit is contained in:
21
dockers/sympa/wait-sympa.sh
Executable file
21
dockers/sympa/wait-sympa.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
#quoi: lancer des cmdes iptables lorsque sympa est up
|
||||
#quand: 02/12/2025
|
||||
#qui: fab
|
||||
|
||||
CONTAINER="sympaServ"
|
||||
HOST_SCRIPT="/kaz/dockers/sympa/updateFirewall.sh"
|
||||
|
||||
echo "On attend que sympa soit UP"
|
||||
|
||||
# Boucle jusqu'à ce qu'il soit en état running
|
||||
while :; do
|
||||
state=$(docker inspect -f '{{.State.Running}}' "$CONTAINER" 2>/dev/null)
|
||||
if [ "$state" = "true" ]; then
|
||||
echo "$CONTAINER est up. démarrage de $HOST_SCRIPT..."
|
||||
bash "$HOST_SCRIPT"
|
||||
exit 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
Reference in New Issue
Block a user