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:
@@ -220,7 +220,7 @@ START=$(date +%s)
|
||||
write_onboard_phase() {
|
||||
local target_id="$1" phase="$2"
|
||||
local key="${target_id}_PHASE${phase}_DONE"
|
||||
local state_file="${VARAVERK_SETUP_FILE:-${STATE_DIR:-/boot/config}/varaverk_setup.db}"
|
||||
local state_file="$(platform_setup_db_path)"
|
||||
[[ "$DRY_RUN" == true ]] && { warn "DRY RUN — would write ${key}=true"; return 0; }
|
||||
if grep -q "^${key}=" "$state_file" 2>/dev/null; then
|
||||
sed -i "s|^${key}=.*|${key}=true|" "$state_file"
|
||||
@@ -412,7 +412,7 @@ elif [[ "$PHASE1_ONLY" == true ]]; then
|
||||
# Write key-ready flag so UI can show the manual-install state
|
||||
[[ "$DRY_RUN" == false ]] && {
|
||||
local kflag="${MIRROR_ID}_KEY_READY"
|
||||
local _setup_f="${VARAVERK_SETUP_FILE:-${STATE_DIR:-/boot/config}/varaverk_setup.db}"
|
||||
local _setup_f="$(platform_setup_db_path)"
|
||||
grep -q "^${kflag}=" "$_setup_f" 2>/dev/null \
|
||||
&& sed -i "s|^${kflag}=.*|${kflag}=true|" "$_setup_f" \
|
||||
|| echo "${kflag}=true" >> "$_setup_f"
|
||||
|
||||
Reference in New Issue
Block a user