From a00a6e5f2bb404e41cdecf9a7e4149b012755d31 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Thu, 2 Jul 2026 21:50:48 +0200 Subject: [PATCH] Update backup_host.sh --- scripts/backup_restore/backup_host.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/backup_restore/backup_host.sh b/scripts/backup_restore/backup_host.sh index 8261ec34..7170517a 100755 --- a/scripts/backup_restore/backup_host.sh +++ b/scripts/backup_restore/backup_host.sh @@ -2192,7 +2192,13 @@ _rs_run_complete_guided() { # a small summary block for the confirm dialog — informative # only, no yes/no. RS_NIC_REMAP_SUMMARY="" - if (( ${#HB_NIC_REMAP[@]:-0} > 0 || ${#HB_NIC_MAC_CHANGED[@]:-0} > 0 )); then + # `${#ARR[@]:-0}` is NOT valid bash — you get either length OR + # default, never both. `hb_plan_nic_remaps` initialises both + # arrays (empty declarations) before this runs, so plain + # `${#ARR[@]}` returns 0 for the empty case without tripping + # `set -u`. Reported by a user during restore: "line 2195: bad + # substitution". + if (( ${#HB_NIC_REMAP[@]} > 0 || ${#HB_NIC_MAC_CHANGED[@]} > 0 )); then local nr_body entry old_if new_if nic_mac old_mac nr_body="\Zb$(translate "NIC changes detected — adjusted automatically")\ZB"$'\n\n' for entry in "${HB_NIC_REMAP[@]}"; do