Fix docker compose ps command usage across scripts

Replace deprecated `docker compose ps | grep` patterns with the more reliable `docker compose ps --status running --services | grep` command. This ensures consistent container status checking across backup, restore, and update scripts.

Also fix regex pattern in update.sh for French "oui" validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
BeauTroll
2025-12-17 05:51:12 +01:00
parent eff651e720
commit 9ad3cbe0d7
3 changed files with 7 additions and 5 deletions

View File

@@ -59,16 +59,16 @@ log ""
# Sauvegarder la version actuelle
CURRENT_VERSION=""
if docker compose ps | grep -q 'gitea.*running'; then
if docker compose ps --status running --services | grep -q '^gitea$'; then
CURRENT_VERSION=$(docker compose exec -T gitea gitea --version 2>/dev/null | head -n 1 || echo "Inconnue")
log "Version actuelle: $CURRENT_VERSION"
fi
# Vérifier que les services tournent
if ! docker compose ps | grep -q 'gitea.*running'; then
if ! docker compose ps --status running --services | grep -q '^gitea$'; then
log "${YELLOW}Avertissement: Gitea ne semble pas être en cours d'exécution${NC}"
read -p "Continuer quand même? (oui/non) " -r
if [[ ! $REPLY =~ ^[Oo][Uu][Ii]$ ]]; then
if [[ ! $REPLY =~ ^[Oo][Uu][Ui]$ ]]; then
log "Mise à jour annulée par l'utilisateur."
exit 0
fi