added get bay number
This commit is contained in:
@ -32,6 +32,19 @@ get_drives_info() {
|
||||
done
|
||||
}
|
||||
|
||||
get_bay_number() {
|
||||
local drive=$1
|
||||
local path=$(readlink -f "/dev/disk/by-path/"*$(basename "$drive"))
|
||||
|
||||
# Extract bay number from the path based on medium2's mapping
|
||||
for mapping in ${DRIVE_MAPPINGS[medium2]}; do
|
||||
if [[ $path =~ $mapping ]]; then
|
||||
echo "${mapping##*:}"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
get_physical_mapping() {
|
||||
local -A drive_map
|
||||
|
||||
|
||||
Reference in New Issue
Block a user