added safe guards to all scripts that need it. all reference comm.sh like it should be

This commit is contained in:
2026-04-20 17:18:25 -04:00
parent 72940ec202
commit e83473ab8e
20 changed files with 263 additions and 32 deletions
+7
View File
@@ -81,6 +81,8 @@ if [[ ! -d "$LIDARR_MUSIC_ROOT" ]]; then
exit 1
fi
acquire_lock "wait"
success "Config validated"
# -----------------------------------------------------------------------------------------------
@@ -156,6 +158,11 @@ is_protected_file() {
echo ""
echo "━━━ $ICON_SYNC Fetching Lidarr Tracked Files ━━━"
check_api "$LIDARR_URL" "Lidarr" || {
notify "Lidarr cleanup aborted on $(hostname) — API unreachable" "Lidarr Cleanup" "warning"
exit 1
}
info "Querying Lidarr API: $LIDARR_URL"
TRACKFILE_RESPONSE=$(lidarr_api "trackfile") || {
+2
View File
@@ -47,6 +47,8 @@ fi
success "Running as root"
acquire_lock "wait"
if ! command -v find >/dev/null 2>&1; then
error "find command not found — check findutils installation"
exit 1
+2
View File
@@ -43,6 +43,8 @@ fi
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
acquire_lock "wait"
# -----------------------------------------------------------------------------------------------
# ━━━ $ICON_PERMS Media Permissions ━━━
# -----------------------------------------------------------------------------------------------
+7
View File
@@ -82,6 +82,8 @@ if [[ ! -d "$RADARR_MOVIES_ROOT" ]]; then
exit 1
fi
acquire_lock "wait"
success "Config validated"
# -----------------------------------------------------------------------------------------------
@@ -154,6 +156,11 @@ is_protected_file() {
echo ""
echo "━━━ $ICON_SYNC Fetching Radarr Tracked Files ━━━"
check_api "$RADARR_URL" "Radarr" || {
notify "Radarr cleanup aborted on $(hostname) — API unreachable" "Radarr Cleanup" "warning"
exit 1
}
info "Querying Radarr API: $RADARR_URL"
MOVIEFILE_RESPONSE=$(radarr_api "moviefile") || {
+7
View File
@@ -82,6 +82,8 @@ if [[ ! -d "$SONARR_TV_ROOT" ]]; then
exit 1
fi
acquire_lock "wait"
success "Config validated"
# -----------------------------------------------------------------------------------------------
@@ -154,6 +156,11 @@ is_protected_file() {
echo ""
echo "━━━ $ICON_SYNC Fetching Sonarr Tracked Files ━━━"
check_api "$SONARR_URL" "Sonarr" || {
notify "Sonarr cleanup aborted on $(hostname) — API unreachable" "Sonarr Cleanup" "warning"
exit 1
}
info "Querying Sonarr API: $SONARR_URL"
EPISODEFILE_RESPONSE=$(sonarr_api "episodefile") || {