Compare commits
No commits in common. "95491b42c84d7db5e632f9a1d20fd03dc340f709" and "1371e841707e8e0f3ba847a5265067c985f65459" have entirely different histories.
95491b42c8
...
1371e84170
@ -128,7 +128,7 @@ function select_storage() {
|
|||||||
local USED_FMT=$(numfmt --to=iec --from-unit=K --format %.1f <<<"$USED")
|
local USED_FMT=$(numfmt --to=iec --from-unit=K --format %.1f <<<"$USED")
|
||||||
local FREE_FMT=$(numfmt --to=iec --from-unit=K --format %.1f <<<"$FREE")
|
local FREE_FMT=$(numfmt --to=iec --from-unit=K --format %.1f <<<"$FREE")
|
||||||
local INFO="Free: ${FREE_FMT}B Used: ${USED_FMT}B"
|
local INFO="Free: ${FREE_FMT}B Used: ${USED_FMT}B"
|
||||||
STORAGE_MAP["$DISPLAY"]="$TAG"
|
STORAGE_MAP["$DISPLAY"]="$TAG" # Map DISPLAY to actual TAG
|
||||||
MENU+=("$DISPLAY" "$INFO" "OFF")
|
MENU+=("$DISPLAY" "$INFO" "OFF")
|
||||||
((${#DISPLAY} > COL_WIDTH)) && COL_WIDTH=${#DISPLAY}
|
((${#DISPLAY} > COL_WIDTH)) && COL_WIDTH=${#DISPLAY}
|
||||||
done < <(pvesm status -content "$CONTENT" | awk 'NR>1')
|
done < <(pvesm status -content "$CONTENT" | awk 'NR>1')
|
||||||
@ -150,8 +150,7 @@ function select_storage() {
|
|||||||
"Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \
|
"Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \
|
||||||
16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3)
|
16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
local ret=$?
|
if [[ $? -ne 0 ]]; then
|
||||||
if [[ $ret -ne 0 ]]; then
|
|
||||||
msg_error "Storage selection cancelled by user."
|
msg_error "Storage selection cancelled by user."
|
||||||
exit 202
|
exit 202
|
||||||
fi
|
fi
|
||||||
@ -162,9 +161,11 @@ function select_storage() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${STORAGE_MAP[$DISPLAY_SELECTED]}"
|
break
|
||||||
return
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "${STORAGE_MAP["$DISPLAY_SELECTED"]}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test if required variables are set
|
# Test if required variables are set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user