Add OPERATIONAL SAFEGUARDS headers, skip prefill during active rescans
arr_full_rescan.sh, arr_cache_prefill.sh, and arr_rescan_monitor.sh were missing the standard SAFEGUARDS header section other Arrs_Stack/Tools scripts have. Also: arr_cache_prefill.sh now checks for an active rescan before fetching, instead of doing a live fetch that arr_cache_write() would just refuse to persist anyway -- avoids wasted API calls every 30min during a long rescan. arr_rescan_monitor.sh was also missing an actual root check despite writing cache files; added it to match convention rather than just document a safeguard that wasn't there.
This commit is contained in:
@@ -19,6 +19,19 @@
|
||||
# this for scans it triggers itself; this tool covers everything else.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL SAFEGUARDS
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Root required — matches convention across Arrs_Stack/Tools/, writes cache files
|
||||
# Arg validation — arr_type must be lidarr/sonarr/radarr, usage error otherwise
|
||||
# Timeout, never waits forever — default 2h ceiling, override via second positional arg;
|
||||
# on timeout, cache is left untouched rather than acted on stale
|
||||
# --status mode — read-only, shows active rescan + cache age, waits/writes nothing
|
||||
# --dry-run mode — shows what would be waited on, waits/writes nothing
|
||||
# Triggers nothing — never starts a rescan itself, only watches one already running;
|
||||
# use arr_full_rescan.sh or the arr's own UI/API to start one
|
||||
#
|
||||
# ==============================================================================================
|
||||
# RUNTIME MODES
|
||||
# ==============================================================================================
|
||||
#
|
||||
@@ -40,6 +53,12 @@
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../load_config.sh"
|
||||
parse_args "$@"
|
||||
|
||||
if [[ "$EUID" -ne 0 ]]; then
|
||||
error "Must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
detect_hosts
|
||||
|
||||
ARR_TYPE="${PARSED_ARGS[0]:-}"
|
||||
|
||||
Reference in New Issue
Block a user