Rename --skip-strike-list to --skip-age-check — strike system was removed, flag name was stale
This commit is contained in:
+13
-13
@@ -105,7 +105,7 @@
|
|||||||
# lidarr_cleanup.sh --log — verbose output
|
# lidarr_cleanup.sh --log — verbose output
|
||||||
# lidarr_cleanup.sh --status — show config and exit
|
# lidarr_cleanup.sh --status — show config and exit
|
||||||
# lidarr_cleanup.sh --i-know-what-im-doing — bypass size threshold
|
# lidarr_cleanup.sh --i-know-what-im-doing — bypass size threshold
|
||||||
# lidarr_cleanup.sh --i-know-what-im-doing --skip-strike-list — NUCLEAR MODE
|
# lidarr_cleanup.sh --i-know-what-im-doing --skip-age-check — NUCLEAR MODE
|
||||||
#
|
#
|
||||||
# NUCLEAR MODE: both flags bypass age check AND size threshold. Use when Soularr
|
# NUCLEAR MODE: both flags bypass age check AND size threshold. Use when Soularr
|
||||||
# has filled the gaps and you want a clean one-pass wipe. User accepts full
|
# has filled the gaps and you want a clean one-pass wipe. User accepts full
|
||||||
@@ -118,15 +118,15 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/../load_config.sh"
|
source "$SCRIPT_DIR/../load_config.sh"
|
||||||
|
|
||||||
# ── Special flag pre-processing ───────────────────────────────────────────────────────────────
|
# ── Special flag pre-processing ───────────────────────────────────────────────────────────────
|
||||||
# Filter --i-know-what-im-doing and --skip-strike-list before parse_args
|
# Filter --i-know-what-im-doing and --skip-age-check before parse_args
|
||||||
# to avoid unknown flag errors — these are handled separately below.
|
# to avoid unknown flag errors — both are handled separately below.
|
||||||
I_KNOW=false
|
I_KNOW=false
|
||||||
SKIP_STRIKES=false
|
SKIP_AGE_CHECK=false
|
||||||
FILTERED_ARGS=()
|
FILTERED_ARGS=()
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--i-know-what-im-doing) I_KNOW=true ;;
|
--i-know-what-im-doing) I_KNOW=true ;;
|
||||||
--skip-strike-list) SKIP_STRIKES=true ;;
|
--skip-age-check) SKIP_AGE_CHECK=true ;;
|
||||||
*) FILTERED_ARGS+=("$arg") ;;
|
*) FILTERED_ARGS+=("$arg") ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -134,13 +134,13 @@ done
|
|||||||
parse_args "${FILTERED_ARGS[@]}"
|
parse_args "${FILTERED_ARGS[@]}"
|
||||||
|
|
||||||
# ── Nuclear mode warning ──────────────────────────────────────────────────────────────────────
|
# ── Nuclear mode warning ──────────────────────────────────────────────────────────────────────
|
||||||
if [[ "$I_KNOW" == true ]] && [[ "$SKIP_STRIKES" == true ]] && [[ "$DRY_RUN" != true ]]; then
|
if [[ "$I_KNOW" == true ]] && [[ "$SKIP_AGE_CHECK" == true ]] && [[ "$DRY_RUN" != true ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
echo "⚠️ WARNING — NUCLEAR MODE ACTIVE"
|
echo "⚠️ WARNING — NUCLEAR MODE ACTIVE"
|
||||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
echo " Flags: --i-know-what-im-doing --skip-strike-list"
|
echo " Flags: --i-know-what-im-doing --skip-age-check"
|
||||||
echo " Strike system: BYPASSED — deletes on first pass"
|
echo " Age check: BYPASSED — deletes on first pass"
|
||||||
echo " Size threshold: BYPASSED — no GB limit"
|
echo " Size threshold: BYPASSED — no GB limit"
|
||||||
echo " Data recovery: NOT POSSIBLE after deletion"
|
echo " Data recovery: NOT POSSIBLE after deletion"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -221,7 +221,7 @@ echo " $MY_ID ($LOCAL_SERVER_NAME) — $LIDARR_URL"
|
|||||||
|
|
||||||
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted"
|
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted"
|
||||||
[[ "$I_KNOW" == true ]] && warn "OVERRIDE — --i-know-what-im-doing active"
|
[[ "$I_KNOW" == true ]] && warn "OVERRIDE — --i-know-what-im-doing active"
|
||||||
[[ "$SKIP_STRIKES" == true ]] && warn "OVERRIDE — --skip-strike-list active — age check bypassed"
|
[[ "$SKIP_AGE_CHECK" == true ]] && warn "OVERRIDE — --skip-age-check active — age check bypassed"
|
||||||
|
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# ━━━ Status ━━━
|
# ━━━ Status ━━━
|
||||||
@@ -240,7 +240,7 @@ if [[ "$SHOW_STATUS" == true ]]; then
|
|||||||
echo "$ICON_GEAR Protected patterns: ${LIDARR_PROTECTED_PATTERNS[*]}"
|
echo "$ICON_GEAR Protected patterns: ${LIDARR_PROTECTED_PATTERNS[*]}"
|
||||||
echo "$ICON_GEAR Dry Run: $DRY_RUN"
|
echo "$ICON_GEAR Dry Run: $DRY_RUN"
|
||||||
echo "$ICON_GEAR I know: $I_KNOW"
|
echo "$ICON_GEAR I know: $I_KNOW"
|
||||||
echo "$ICON_GEAR Skip strikes: $SKIP_STRIKES"
|
echo "$ICON_GEAR Skip age check: $SKIP_AGE_CHECK"
|
||||||
echo "━━━━━━━━━━━━━━━━━━━━━━━"
|
echo "━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -520,7 +520,7 @@ while IFS= read -r filepath; do
|
|||||||
FILE_MTIME=$(stat -c %Y "$filepath" 2>/dev/null || echo 0)
|
FILE_MTIME=$(stat -c %Y "$filepath" 2>/dev/null || echo 0)
|
||||||
FILE_AGE=$(( NOW - FILE_MTIME ))
|
FILE_AGE=$(( NOW - FILE_MTIME ))
|
||||||
|
|
||||||
if [[ "$FILE_AGE" -lt "$AGE_SECONDS" ]] && [[ "$SKIP_STRIKES" != true ]]; then
|
if [[ "$FILE_AGE" -lt "$AGE_SECONDS" ]] && [[ "$SKIP_AGE_CHECK" != true ]]; then
|
||||||
log "RECENT (skipping): $filepath"
|
log "RECENT (skipping): $filepath"
|
||||||
(( RECENT_COUNT++ ))
|
(( RECENT_COUNT++ ))
|
||||||
continue
|
continue
|
||||||
@@ -550,7 +550,7 @@ if [[ "$TOTAL_DELETE_BYTES" -gt "$MAX_DELETE_BYTES" ]]; then
|
|||||||
error "Deletion would exceed ${LIDARR_MAX_DELETE_GB}GB — $TOTAL_HUMAN would be deleted"
|
error "Deletion would exceed ${LIDARR_MAX_DELETE_GB}GB — $TOTAL_HUMAN would be deleted"
|
||||||
error "Review ORPHAN lines above carefully before proceeding"
|
error "Review ORPHAN lines above carefully before proceeding"
|
||||||
error "Rerun with: --i-know-what-im-doing"
|
error "Rerun with: --i-know-what-im-doing"
|
||||||
error "To also bypass age check: add --skip-strike-list"
|
error "To also bypass age check: add --skip-age-check"
|
||||||
notify "Lidarr cleanup halted on $(hostname) — ${TOTAL_HUMAN} requires --i-know-what-im-doing" \
|
notify "Lidarr cleanup halted on $(hostname) — ${TOTAL_HUMAN} requires --i-know-what-im-doing" \
|
||||||
"Lidarr Cleanup" "warning"
|
"Lidarr Cleanup" "warning"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -572,7 +572,7 @@ if [[ "$DRY_RUN" == false ]]; then
|
|||||||
|
|
||||||
if is_music_file "$filepath"; then
|
if is_music_file "$filepath"; then
|
||||||
[[ "$FILE_AGE" -lt "$AGE_SECONDS" ]] && \
|
[[ "$FILE_AGE" -lt "$AGE_SECONDS" ]] && \
|
||||||
[[ "$SKIP_STRIKES" != true ]] && continue
|
[[ "$SKIP_AGE_CHECK" != true ]] && continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$filepath" 2>/dev/null || error "Failed to delete: $filepath"
|
rm -f "$filepath" 2>/dev/null || error "Failed to delete: $filepath"
|
||||||
|
|||||||
Reference in New Issue
Block a user