mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-14 02:33:58 +02:00
Remove unnecessary set +u/set -u in create_lxc_container
only as test exist
This commit is contained in:
@@ -4505,10 +4505,8 @@ create_lxc_container() {
|
|||||||
|
|
||||||
ONLINE_TEMPLATES=()
|
ONLINE_TEMPLATES=()
|
||||||
ONLINE_TEMPLATE=""
|
ONLINE_TEMPLATE=""
|
||||||
set +u
|
|
||||||
mapfile -t ONLINE_TEMPLATES < <(pveam available -section system 2>/dev/null | grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' | awk '{print $2}' | grep -E "^${TEMPLATE_SEARCH}.*${TEMPLATE_PATTERN}" | sort -t - -k 2 -V 2>/dev/null || true)
|
mapfile -t ONLINE_TEMPLATES < <(pveam available -section system 2>/dev/null | grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' | awk '{print $2}' | grep -E "^${TEMPLATE_SEARCH}.*${TEMPLATE_PATTERN}" | sort -t - -k 2 -V 2>/dev/null || true)
|
||||||
[[ ${#ONLINE_TEMPLATES[@]} -gt 0 ]] && ONLINE_TEMPLATE="${ONLINE_TEMPLATES[-1]}"
|
[[ ${#ONLINE_TEMPLATES[@]} -gt 0 ]] && ONLINE_TEMPLATE="${ONLINE_TEMPLATES[-1]}"
|
||||||
set -u
|
|
||||||
|
|
||||||
TEMPLATE="$ONLINE_TEMPLATE"
|
TEMPLATE="$ONLINE_TEMPLATE"
|
||||||
TEMPLATE_SOURCE="online"
|
TEMPLATE_SOURCE="online"
|
||||||
@@ -4522,7 +4520,6 @@ create_lxc_container() {
|
|||||||
|
|
||||||
# Get all available versions for this OS type
|
# Get all available versions for this OS type
|
||||||
AVAILABLE_VERSIONS=()
|
AVAILABLE_VERSIONS=()
|
||||||
set +u
|
|
||||||
mapfile -t AVAILABLE_VERSIONS < <(
|
mapfile -t AVAILABLE_VERSIONS < <(
|
||||||
pveam available -section system 2>/dev/null |
|
pveam available -section system 2>/dev/null |
|
||||||
grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' |
|
grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' |
|
||||||
@@ -4531,7 +4528,6 @@ create_lxc_container() {
|
|||||||
sed -E "s/.*${PCT_OSTYPE}-([0-9]+(\.[0-9]+)?).*/\1/" |
|
sed -E "s/.*${PCT_OSTYPE}-([0-9]+(\.[0-9]+)?).*/\1/" |
|
||||||
sort -u -V 2>/dev/null
|
sort -u -V 2>/dev/null
|
||||||
)
|
)
|
||||||
set -u
|
|
||||||
|
|
||||||
if [[ ${#AVAILABLE_VERSIONS[@]} -gt 0 ]]; then
|
if [[ ${#AVAILABLE_VERSIONS[@]} -gt 0 ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
@@ -4547,7 +4543,6 @@ create_lxc_container() {
|
|||||||
TEMPLATE_SEARCH="${PCT_OSTYPE}-${PCT_OSVERSION}"
|
TEMPLATE_SEARCH="${PCT_OSTYPE}-${PCT_OSVERSION}"
|
||||||
|
|
||||||
ONLINE_TEMPLATES=()
|
ONLINE_TEMPLATES=()
|
||||||
set +u
|
|
||||||
mapfile -t ONLINE_TEMPLATES < <(
|
mapfile -t ONLINE_TEMPLATES < <(
|
||||||
pveam available -section system 2>/dev/null |
|
pveam available -section system 2>/dev/null |
|
||||||
grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' |
|
grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' |
|
||||||
@@ -4555,7 +4550,6 @@ create_lxc_container() {
|
|||||||
grep -E "^${TEMPLATE_SEARCH}-.*${TEMPLATE_PATTERN}" |
|
grep -E "^${TEMPLATE_SEARCH}-.*${TEMPLATE_PATTERN}" |
|
||||||
sort -t - -k 2 -V 2>/dev/null || true
|
sort -t - -k 2 -V 2>/dev/null || true
|
||||||
)
|
)
|
||||||
set -u
|
|
||||||
|
|
||||||
if [[ ${#ONLINE_TEMPLATES[@]} -gt 0 ]]; then
|
if [[ ${#ONLINE_TEMPLATES[@]} -gt 0 ]]; then
|
||||||
TEMPLATE="${ONLINE_TEMPLATES[-1]}"
|
TEMPLATE="${ONLINE_TEMPLATES[-1]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user