Add docker availability check to all scripts that use docker commands

22 scripts used docker without verifying it's present. Consistent with the
pattern already established in Docker_Essentials scripts. Added after acquire_lock
and before detect_hosts in each script's setup section.
This commit is contained in:
Gmer4Lfe
2026-05-20 18:35:34 -04:00
parent 740710e0d0
commit e932936acc
22 changed files with 110 additions and 0 deletions
+5
View File
@@ -263,6 +263,11 @@ fi
acquire_lock # strict single instance — notifies on collision
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
resolve_remote_ip
+5
View File
@@ -151,6 +151,11 @@ fi
acquire_lock # strict single instance — modifies iptables and containers
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
resolve_remote_ip
+5
View File
@@ -165,6 +165,11 @@ validate_unraid_cmd \
[[ -n "${LIDARR_LOCK_WARN_AGE:-}" ]] && LOCK_WARN_AGE="$LIDARR_LOCK_WARN_AGE"
acquire_lock "wait"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases LIDARR_URL, LIDARR_API_KEY, LIDARR_MUSIC_ROOT
detect_hosts
+5
View File
@@ -151,6 +151,11 @@ validate_unraid_cmd \
acquire_lock "wait"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases RADARR_URL, RADARR_API_KEY, RADARR_MOVIES_ROOT
detect_hosts
+5
View File
@@ -151,6 +151,11 @@ validate_unraid_cmd \
acquire_lock "wait"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases SONARR_URL, SONARR_API_KEY, SONARR_TV_ROOT
detect_hosts
+5
View File
@@ -60,6 +60,11 @@ validate_unraid_cmd \
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no stop scripts will be executed"
+5
View File
@@ -88,6 +88,11 @@ validate_unraid_cmd \
"" "" \
"unRAID notify script" || warn "unRAID notify script not found — native notifications disabled"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
resolve_remote_ip
+5
View File
@@ -72,6 +72,11 @@ fi
acquire_lock "wait"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases all HOST*_TRANSCODE_* vars
detect_hosts
+5
View File
@@ -83,6 +83,11 @@ validate_unraid_cmd \
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
resolve_remote_ip
+5
View File
@@ -237,6 +237,11 @@ validate_unraid_cmd \
"" "" \
"unRAID notify script" || warn "unRAID notify script not found — native notifications disabled"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases PARTNERSHIP_AUTH_WEBUIS, PARTNERSHIP_MIRROR_BACKUPS
detect_hosts
+5
View File
@@ -97,6 +97,11 @@ PARTNERSHIP_LIB_MODE=1 source "$SCRIPT_DIR/partnership_manager.sh"
# ==============================================================================================
[[ "$EUID" -ne 0 ]] && { error "Must be run as root"; exit 1; }
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
+5
View File
@@ -158,6 +158,11 @@ parse_args "${FILTERED_ARGS[@]}"
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
+5
View File
@@ -165,6 +165,11 @@ fi
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
validate_unraid_cmd \
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
"" "" \
+5
View File
@@ -88,6 +88,11 @@ fi
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
validate_unraid_cmd \
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
"" "" \
+5
View File
@@ -113,6 +113,11 @@ fi
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases HOST*_EMBY_CONTAINER → EMBY_CONTAINER
detect_hosts
+5
View File
@@ -116,6 +116,11 @@ validate_unraid_cmd \
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID — used in output
detect_hosts
+5
View File
@@ -157,6 +157,11 @@ validate_unraid_cmd \
acquire_lock "wait"
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID and aliases all HOST*_TRANSCODE_* vars
detect_hosts
+5
View File
@@ -64,6 +64,11 @@ if [[ "$EUID" -ne 0 ]]; then
fi
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
# detect_hosts() sets MY_ID — needed for sparse checkout configuration
detect_hosts
+5
View File
@@ -100,6 +100,11 @@ validate_unraid_cmd \
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be cleared"
+5
View File
@@ -106,6 +106,11 @@ validate_unraid_cmd \
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
+5
View File
@@ -124,6 +124,11 @@ fi
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
DOCKER_TIMEOUT=15
+5
View File
@@ -121,6 +121,11 @@ validate_unraid_cmd \
acquire_lock
if ! command -v docker &>/dev/null; then
error "Docker command not found"
exit 1
fi
detect_hosts
# Soft IP resolution — rsync_stop continues local-only if remote unreachable