Update create_lxc.sh
This commit is contained in:
parent
7561e26c0a
commit
f494e68016
@ -116,6 +116,7 @@ function select_storage() {
|
|||||||
local -a MENU
|
local -a MENU
|
||||||
local -A STORAGE_MAP
|
local -A STORAGE_MAP
|
||||||
local COL_WIDTH=0
|
local COL_WIDTH=0
|
||||||
|
|
||||||
while read -r TAG TYPE _ TOTAL USED FREE _; do
|
while read -r TAG TYPE _ TOTAL USED FREE _; do
|
||||||
[[ -n "$TAG" && -n "$TYPE" ]] || continue
|
[[ -n "$TAG" && -n "$TYPE" ]] || continue
|
||||||
local DISPLAY="${TAG} (${TYPE})"
|
local DISPLAY="${TAG} (${TYPE})"
|
||||||
@ -134,20 +135,15 @@ function select_storage() {
|
|||||||
|
|
||||||
if [ $((${#MENU[@]} / 3)) -eq 1 ]; then
|
if [ $((${#MENU[@]} / 3)) -eq 1 ]; then
|
||||||
STORAGE_RESULT="${STORAGE_MAP[${MENU[0]}]}"
|
STORAGE_RESULT="${STORAGE_MAP[${MENU[0]}]}"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local WIDTH=$((COL_WIDTH + 42))
|
local WIDTH=$((COL_WIDTH + 42))
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
local DISPLAY_SELECTED=$(
|
local DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
|
||||||
whiptail --backtitle "Proxmox VE Helper Scripts" \
|
--title "Storage Pools" \
|
||||||
--title "Storage Pools" \
|
--radiolist "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \
|
||||||
--radiolist "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
|
|
||||||
)
|
|
||||||
|
|
||||||
[[ $? -ne 0 ]] && return 3
|
[[ $? -ne 0 ]] && return 3
|
||||||
|
|
||||||
@ -160,6 +156,7 @@ function select_storage() {
|
|||||||
return 0
|
return 0
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test if required variables are set
|
# Test if required variables are set
|
||||||
[[ "${CTID:-}" ]] || {
|
[[ "${CTID:-}" ]] || {
|
||||||
msg_error "You need to set 'CTID' variable."
|
msg_error "You need to set 'CTID' variable."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user