diff --git a/driveAtlas.sh b/driveAtlas.sh index 60c564d..b99ba1b 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -898,13 +898,13 @@ declare -A DEVICE_TO_BAY for bay in "${!DRIVE_MAP[@]}"; do device="${DRIVE_MAP[$bay]}" if [[ -n "$device" && "$device" != "EMPTY" ]]; then - DEVICE_TO_BAY[$device]=$bay + DEVICE_TO_BAY["$device"]="$bay" fi done # Sort drives by bay position (numeric bays first, then m2 slots) # Combine numeric bays (sorted numerically) with m2 slots (sorted alphanumerically) -all_bays=$(printf '%s\n' "${!DRIVE_MAP[@]}" | grep -E '^[0-9]+$' | sort -n; printf '%s\n' "${!DRIVE_MAP[@]}" | grep -E '^m2-' | sort) +all_bays="$(printf '%s\n' "${!DRIVE_MAP[@]}" | grep -E '^[0-9]+$' | sort -n; printf '%s\n' "${!DRIVE_MAP[@]}" | grep -E '^m2-' | sort)" # Cache lsblk data to reduce redundant calls # Single call gets all info we need: size and mount points