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
+3 -3
View File
@@ -345,7 +345,7 @@ state_init() {
# Returns 0 (true) if the local partnership DB reports an ACTIVE partnership.
# Reads /boot/config/partnership_<hostname>.db — no subprocess, no SSH.
check_partnership_active() {
local state_file="${STATE_DIR:-/boot/config}/partnership_${LOCAL_SERVER_NAME}.db"
local state_file="${STATE_DIR}/partnership_${LOCAL_SERVER_NAME}.db"
local state
state=$(grep "^state=" "$state_file" 2>/dev/null | cut -d= -f2)
[[ "$state" == "ACTIVE" ]]
@@ -603,13 +603,13 @@ if [[ "$SHOW_STATUS" == true ]]; then
TIER4=$(state_get tier4_started)
STRIKES=$(state_get handback_strikes)
local_ver=$(grep -oP '(?<=version=")[^"]+' /etc/unraid-version 2>/dev/null || echo "unknown")
local_ver=$(platform_get_os_version 2>/dev/null || echo "unknown")
echo ""
echo "━━━━━ $ICON_SUMMARY FALLBACK STATUS ━━━━━"
echo "$ICON_HOST My ID: $MY_ID ($LOCAL_SERVER_NAME)"
echo "$ICON_HOST Remote ID: $REMOTE_ID ($REMOTE_SERVER_NAME$REMOTE_SERVER)"
echo "$ICON_GEAR unRAID ver: $local_ver"
echo "$ICON_GEAR OS ver: $local_ver"
echo "$ICON_FALLBACK State: $CURRENT_STATE"
echo "$ICON_NET Local DDNS: ${LOCAL_DDNS_CONTAINERS[*]:-none}"
echo "$ICON_NET Remote DDNS: ${REMOTE_DDNS_CONTAINERS[*]:-none}"