diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index d74ee9fa..fe4fa8ec 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -110,6 +110,19 @@ function select_storage() { ;; 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 STORAGE_MAP local COL_WIDTH=0