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:
@@ -263,6 +263,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock # strict single instance — notifies on collision
|
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
|
detect_hosts
|
||||||
resolve_remote_ip
|
resolve_remote_ip
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock # strict single instance — modifies iptables and containers
|
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
|
detect_hosts
|
||||||
resolve_remote_ip
|
resolve_remote_ip
|
||||||
|
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ validate_unraid_cmd \
|
|||||||
[[ -n "${LIDARR_LOCK_WARN_AGE:-}" ]] && LOCK_WARN_AGE="$LIDARR_LOCK_WARN_AGE"
|
[[ -n "${LIDARR_LOCK_WARN_AGE:-}" ]] && LOCK_WARN_AGE="$LIDARR_LOCK_WARN_AGE"
|
||||||
acquire_lock "wait"
|
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() sets MY_ID and aliases LIDARR_URL, LIDARR_API_KEY, LIDARR_MUSIC_ROOT
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock "wait"
|
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() sets MY_ID and aliases RADARR_URL, RADARR_API_KEY, RADARR_MOVIES_ROOT
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock "wait"
|
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() sets MY_ID and aliases SONARR_URL, SONARR_API_KEY, SONARR_TV_ROOT
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no stop scripts will be executed"
|
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no stop scripts will be executed"
|
||||||
|
|||||||
@@ -88,6 +88,11 @@ validate_unraid_cmd \
|
|||||||
"" "" \
|
"" "" \
|
||||||
"unRAID notify script" || warn "unRAID notify script not found — native notifications disabled"
|
"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
|
detect_hosts
|
||||||
resolve_remote_ip
|
resolve_remote_ip
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock "wait"
|
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() sets MY_ID and aliases all HOST*_TRANSCODE_* vars
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
resolve_remote_ip
|
resolve_remote_ip
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,11 @@ validate_unraid_cmd \
|
|||||||
"" "" \
|
"" "" \
|
||||||
"unRAID notify script" || warn "unRAID notify script not found — native notifications disabled"
|
"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() sets MY_ID and aliases PARTNERSHIP_AUTH_WEBUIS, PARTNERSHIP_MIRROR_BACKUPS
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -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; }
|
[[ "$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
|
detect_hosts
|
||||||
|
|
||||||
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
|
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
|
||||||
|
|||||||
@@ -158,6 +158,11 @@ parse_args "${FILTERED_ARGS[@]}"
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
|
OWNER_ID="${PARTNERSHIP_OWNER_HOST:-HOST1}"
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
validate_unraid_cmd \
|
validate_unraid_cmd \
|
||||||
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
||||||
"" "" \
|
"" "" \
|
||||||
|
|||||||
@@ -88,6 +88,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
validate_unraid_cmd \
|
validate_unraid_cmd \
|
||||||
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
"/usr/local/emhttp/plugins/dynamix/scripts/notify" \
|
||||||
"" "" \
|
"" "" \
|
||||||
|
|||||||
@@ -113,6 +113,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock
|
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() sets MY_ID and aliases HOST*_EMBY_CONTAINER → EMBY_CONTAINER
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock
|
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() sets MY_ID — used in output
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock "wait"
|
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() sets MY_ID and aliases all HOST*_TRANSCODE_* vars
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
acquire_lock
|
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() sets MY_ID — needed for sparse checkout configuration
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be cleared"
|
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be cleared"
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
|
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
|
||||||
|
|||||||
@@ -124,6 +124,11 @@ fi
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
DOCKER_TIMEOUT=15
|
DOCKER_TIMEOUT=15
|
||||||
|
|||||||
@@ -121,6 +121,11 @@ validate_unraid_cmd \
|
|||||||
|
|
||||||
acquire_lock
|
acquire_lock
|
||||||
|
|
||||||
|
if ! command -v docker &>/dev/null; then
|
||||||
|
error "Docker command not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|
||||||
# Soft IP resolution — rsync_stop continues local-only if remote unreachable
|
# Soft IP resolution — rsync_stop continues local-only if remote unreachable
|
||||||
|
|||||||
Reference in New Issue
Block a user