Filter and display available LXC container versions
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled

Added a grep to ensure only valid version numbers are listed and improved the display of available versions with formatting. This enhances clarity and prevents non-version strings from appearing in the version selection.
This commit is contained in:
CanbiZ 2025-10-21 14:30:06 +02:00
parent 9b624944c7
commit 7d8a42fe97

View File

@ -3062,11 +3062,12 @@ create_lxc_container() {
pveam available -section system 2>/dev/null |
grep "^${PCT_OSTYPE}-" |
sed -E 's/.*'"${PCT_OSTYPE}"'-([0-9]+\.[0-9]+).*/\1/' |
sort -V -u
grep -E '^[0-9]+\.[0-9]+$' |
sort -u -V 2>/dev/null || sort -u
)
if [[ ${#AVAILABLE_VERSIONS[@]} -gt 0 ]]; then
msg_info "Available versions:"
echo -e "\n${BL}Available versions:${CL}"
for i in "${!AVAILABLE_VERSIONS[@]}"; do
echo " [$((i + 1))] ${AVAILABLE_VERSIONS[$i]}"
done