testing change
This commit is contained in:
@ -48,7 +48,10 @@ build_drive_map() {
|
|||||||
local host=$(hostname)
|
local host=$(hostname)
|
||||||
declare -A drive_map
|
declare -A drive_map
|
||||||
|
|
||||||
# Get mapping for current host
|
# Add debug output
|
||||||
|
echo "DEBUG: Current host: $host"
|
||||||
|
echo "DEBUG: Mapping found: ${DRIVE_MAPPINGS[$host]}"
|
||||||
|
|
||||||
local mapping=${DRIVE_MAPPINGS[$host]}
|
local mapping=${DRIVE_MAPPINGS[$host]}
|
||||||
|
|
||||||
if [[ -n "$mapping" ]]; then
|
if [[ -n "$mapping" ]]; then
|
||||||
@ -57,9 +60,12 @@ build_drive_map() {
|
|||||||
local path=${path_slot%:*}
|
local path=${path_slot%:*}
|
||||||
local slot=${path_slot#*:}
|
local slot=${path_slot#*:}
|
||||||
|
|
||||||
|
echo "DEBUG: Checking path: $path for slot: $slot"
|
||||||
|
|
||||||
if [[ -L "/dev/disk/by-path/$path" ]]; then
|
if [[ -L "/dev/disk/by-path/$path" ]]; then
|
||||||
local drive=$(readlink -f "/dev/disk/by-path/$path" | sed 's/.*\///')
|
local drive=$(readlink -f "/dev/disk/by-path/$path" | sed 's/.*\///')
|
||||||
drive_map[$slot]=$drive
|
drive_map[$slot]=$drive
|
||||||
|
echo "DEBUG: Mapped slot $slot to drive $drive"
|
||||||
fi
|
fi
|
||||||
done <<< "$mapping"
|
done <<< "$mapping"
|
||||||
fi
|
fi
|
||||||
@ -68,6 +74,7 @@ build_drive_map() {
|
|||||||
declare -g -A DRIVE_MAP=()
|
declare -g -A DRIVE_MAP=()
|
||||||
for key in "${!drive_map[@]}"; do
|
for key in "${!drive_map[@]}"; do
|
||||||
DRIVE_MAP[$key]=${drive_map[$key]}
|
DRIVE_MAP[$key]=${drive_map[$key]}
|
||||||
|
echo "DEBUG: Final mapping - slot $key: ${drive_map[$key]}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user