Update create_lxc.sh

This commit is contained in:
CanbiZ 2025-07-22 12:21:12 +02:00
parent 277d94584c
commit bd3fb793b7

View File

@ -110,6 +110,19 @@ function select_storage() {
;; ;;
esac esac
# >>> NEW: support STORAGE preset <<<
if [ -n "${STORAGE:-}" ]; then
# validate the given storage
if pvesm status -content "$CONTENT" | awk 'NR>1 {print $1}' | grep -qx "$STORAGE"; then
STORAGE_RESULT="$STORAGE"
msg_info "Using preset storage: $STORAGE_RESULT for $CONTENT_LABEL"
return 0
else
msg_error "Preset storage '$STORAGE' is not valid for content type '$CONTENT'."
return 2
fi
fi
local -a MENU local -a MENU
local -A STORAGE_MAP local -A STORAGE_MAP
local COL_WIDTH=0 local COL_WIDTH=0