diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index f4d4d07b..5b10404b 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -299,7 +299,11 @@ mapfile -t ONLINE_TEMPLATES < <( sed -n "s/.*\($TEMPLATE_SEARCH.*$TEMPLATE_PATTERN.*\)/\1/p" | sort -t - -k 2 -V ) -ONLINE_TEMPLATE="${ONLINE_TEMPLATES[-1]:-}" +if [ ${#ONLINE_TEMPLATES[@]} -gt 0 ]; then + ONLINE_TEMPLATE="${ONLINE_TEMPLATES[-1]}" +else + ONLINE_TEMPLATE="" +fi # 3. Local vs Online if [ ${#LOCAL_TEMPLATES[@]} -gt 0 ]; then