From 5bfbda5e5ed133e6b0958dd69b6efa2762959eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Sat, 18 Oct 2025 19:42:14 +0200 Subject: [PATCH] Fix typos and improve Docker availability checks in backup scripts --- backup.sh | 3 ++- backup_local.sh | 3 ++- backup_restic.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backup.sh b/backup.sh index 355bcbc..ce19dc4 100644 --- a/backup.sh +++ b/backup.sh @@ -5,7 +5,8 @@ if [ "$1" = "local" ]; then elif [ "$1" = "restic" ]; then source /backup_restic.sh elif [ "$1" = "loop" ]; then - # Inifinite loop to keep the container running and let Ofelia scheduler (or any other) manage the execution + # Infinite loop to keep the container running and let Ofelia scheduler (or any other) manage the execution + echo "Entering infinite loop mode. Use external scheduler to trigger backups." while true; do sleep 86400 done diff --git a/backup_local.sh b/backup_local.sh index eaca647..5f07eb4 100644 --- a/backup_local.sh +++ b/backup_local.sh @@ -16,7 +16,8 @@ if [ -z "$TARGET_DIR" ]; then exit 1 fi -if [ ! `docker info` ]; then +docker info > /dev/null 2>&1 +if [ ! $? -eq 0 ]; then echo "Docker is not available." exit 1 fi diff --git a/backup_restic.sh b/backup_restic.sh index daeebee..990db3b 100644 --- a/backup_restic.sh +++ b/backup_restic.sh @@ -22,7 +22,8 @@ if [ -z "$RESTIC_REPOSITORY" ]; then exit 1 fi -if [ ! `docker info` ]; then +docker info > /dev/null 2>&1 +if [ ! $? -eq 0 ]; then echo "Docker is not available." exit 1 fi