Filter and display available LXC container versions
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
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:
parent
9b624944c7
commit
7d8a42fe97
@ -3062,11 +3062,12 @@ create_lxc_container() {
|
|||||||
pveam available -section system 2>/dev/null |
|
pveam available -section system 2>/dev/null |
|
||||||
grep "^${PCT_OSTYPE}-" |
|
grep "^${PCT_OSTYPE}-" |
|
||||||
sed -E 's/.*'"${PCT_OSTYPE}"'-([0-9]+\.[0-9]+).*/\1/' |
|
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
|
if [[ ${#AVAILABLE_VERSIONS[@]} -gt 0 ]]; then
|
||||||
msg_info "Available versions:"
|
echo -e "\n${BL}Available versions:${CL}"
|
||||||
for i in "${!AVAILABLE_VERSIONS[@]}"; do
|
for i in "${!AVAILABLE_VERSIONS[@]}"; do
|
||||||
echo " [$((i + 1))] ${AVAILABLE_VERSIONS[$i]}"
|
echo " [$((i + 1))] ${AVAILABLE_VERSIONS[$i]}"
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user