Remove remaining OS-specific hardcodes from core scripts

OS version reads now go through platform_get_os_version() and
platform_os_version_probe_cmd() instead of grepping /etc/unraid-version directly.

STATE_DIR fallbacks to /boot/config removed — STATE_DIR is always set by
load_config.sh and the fallback encoded a platform-specific path.

Setup DB path references use platform_setup_db_path() instead of the
VARAVERK_SETUP_FILE/-/boot/config compound fallback.

DOCKER_APPDATA_BASE default removed from arr_sync.sh — the adapter sets it.
This commit is contained in:
Gmer4Lfe
2026-06-14 01:22:02 -04:00
parent 3c900ae5c1
commit ee5a07be1c
12 changed files with 65 additions and 42 deletions
+7 -7
View File
@@ -194,7 +194,7 @@ source "$SCRIPT_DIR/../load_config.sh"
source "$SCRIPT_DIR/../Plugin/$PLATFORM/Partnership/containers.sh"
SSH_TIMEOUT=15
BLOCKLIST_FILE="${PARTNERSHIP_BLOCKLIST_FILE:-${STATE_DIR:-/boot/config}/partnership_blocklist.db}"
BLOCKLIST_FILE="${PARTNERSHIP_BLOCKLIST_FILE:-${STATE_DIR}/partnership_blocklist.db}"
# ── Parse mode flags before parse_args ────────────────────────────────────────────────────────
MODE=""
@@ -267,11 +267,11 @@ AM_MIRROR=false
[[ "$MY_ID" == "$MIRROR_ID" ]] && AM_MIRROR=true
# State files
LOCAL_STATE_FILE="${STATE_DIR:-/boot/config}/partnership_${LOCAL_SERVER_NAME}.db"
REMOTE_STATE_FILE="${STATE_DIR:-/boot/config}/partnership_${REMOTE_SERVER_NAME}.db"
OWNER_STATE_FILE="${STATE_DIR:-/boot/config}/partnership_${OWNER}.db"
MIRROR_STATE_FILE="${STATE_DIR:-/boot/config}/partnership_${MIRROR}.db"
OFFLINE_COUNTER="${STATE_DIR:-/boot/config}/partnership_offline_days.db"
LOCAL_STATE_FILE="${STATE_DIR}/partnership_${LOCAL_SERVER_NAME}.db"
REMOTE_STATE_FILE="${STATE_DIR}/partnership_${REMOTE_SERVER_NAME}.db"
OWNER_STATE_FILE="${STATE_DIR}/partnership_${OWNER}.db"
MIRROR_STATE_FILE="${STATE_DIR}/partnership_${MIRROR}.db"
OFFLINE_COUNTER="${STATE_DIR}/partnership_offline_days.db"
# ── Exit Trap — restart locally stopped containers if script crashes mid-cleanup ──────────────
# Used by cleanup_partner_containers() — also shared with partnership_offboard.sh which
@@ -1175,7 +1175,7 @@ if [[ "$MODE" == "onboard" ]]; then
fi
# Write HOST1_LOCAL_DONE flag to setup.db
local_state_file="${VARAVERK_SETUP_FILE:-${STATE_DIR:-/boot/config}/varaverk_setup.db}"
local_state_file="$(platform_setup_db_path)"
if [[ "$DRY_RUN" == false ]]; then
flag_key="${MY_ID}_LOCAL_DONE"
if grep -q "^${flag_key}=" "$local_state_file" 2>/dev/null; then