Compare commits

..

No commits in common. "2b8ccd768866ed918f024cb6616338a250bfd95d" and "bf19cbf69868a538b9dc6fd0372b721712af06d7" have entirely different histories.

View File

@ -144,23 +144,19 @@ normpath(){
# #
# getLatestTemplate PATTERN [VAR] # getLatestTemplate PATTERN [VAR]
# #
# see:
# https://pve.proxmox.com/wiki/Linux_Container
getLatestTemplate(){ getLatestTemplate(){
#IFS=$'\n' IFS=$'\n'
local pattern=$1 local pattern=$1
local templates=($(pveam available | grep -o ''${1}'.*$')) local tamplates=($(pveam available | grep $1))
local latest=${templates[-1]} local latest=${templates[-1]}
@ pveam download local ${latest} pveam download local ${latest}
latest=$(pveam list local | grep -o "^.*$latest")
#latest=($(ls /var/lib/vz/template/cache/${1}*))
[ -z $2 ] \ [ -z $2 ] \
|| eval "$2=${latest}" || eval "$2=${latest}"
} }
# #
# xread [-n] MSG VAR # xread [-n] MSG VAR
# #
@ -324,10 +320,13 @@ pctCreate(){
# pctCreate ID ARGS [PASS] # pctCreate ID ARGS [PASS]
# #
pctCreateAlpine(){ pctCreateAlpine(){
local TEMPLATE if [ $DRY_RUN ] ; then
getLatestTemplate alpine TEMPLATE local TEMPLATE=(/var/lib/vz/template/cache/alpine-3.18\*.tar.xz)
else
local TEMPLATE=($(ls /var/lib/vz/template/cache/alpine-3.18*.tar.xz))
fi
pctCreate $1 "$TEMPLATE" "$2" "$3" pctCreate $1 "${TEMPLATE[-1]}" "$2" "$3"
@ lxc-attach $1 apk update @ lxc-attach $1 apk update
@ lxc-attach $1 apk upgrade @ lxc-attach $1 apk upgrade