fix: detect_hosts() aborts when REMOTE_ID is empty on single-server sparse checkout

${!REMOTE_ID:-unknown} with REMOTE_ID="" is a fatal bash error that terminates
the entire function — not just the line. All subsequent aliases (EMBY_CONTAINER,
TRANSCODE_SSD, RAMDISK_LOW_GB, SSH_KEY) were never set, causing awk syntax errors
and "SSD fallback path missing" warnings in every transcode script invocation.

Guard with an explicit empty check instead of relying on the :- fallback,
which bash does not apply when the indirect expansion itself is invalid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gmer4Lfe
2026-05-08 18:41:48 -04:00
co-authored by Claude Sonnet 4.6
parent 5526bc1eca
commit 10da8108e5
+1 -1
View File
@@ -452,7 +452,7 @@ detect_hosts() {
# ── Set host name strings ─────────────────────────────────────────────────
LOCAL_SERVER_NAME="${!MY_ID}"
REMOTE_SERVER_NAME="${!REMOTE_ID:-unknown}"
[[ -n "$REMOTE_ID" ]] && REMOTE_SERVER_NAME="${!REMOTE_ID}" || REMOTE_SERVER_NAME="unknown"
# ── Set SSH key ───────────────────────────────────────────────────────────
local ssh_key_var="${MY_ID}_SSH_KEY"