mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-25 12:52:04 +00:00
Compare commits
No commits in common. "2b8ccd768866ed918f024cb6616338a250bfd95d" and "bf19cbf69868a538b9dc6fd0372b721712af06d7" have entirely different histories.
2b8ccd7688
...
bf19cbf698
21
.pct-helpers
21
.pct-helpers
@ -144,23 +144,19 @@ normpath(){
|
||||
#
|
||||
# getLatestTemplate PATTERN [VAR]
|
||||
#
|
||||
# see:
|
||||
# https://pve.proxmox.com/wiki/Linux_Container
|
||||
getLatestTemplate(){
|
||||
#IFS=$'\n'
|
||||
IFS=$'\n'
|
||||
local pattern=$1
|
||||
local templates=($(pveam available | grep -o ''${1}'.*$'))
|
||||
local tamplates=($(pveam available | grep $1))
|
||||
local latest=${templates[-1]}
|
||||
|
||||
@ pveam download local ${latest}
|
||||
|
||||
latest=$(pveam list local | grep -o "^.*$latest")
|
||||
#latest=($(ls /var/lib/vz/template/cache/${1}*))
|
||||
pveam download local ${latest}
|
||||
|
||||
[ -z $2 ] \
|
||||
|| eval "$2=${latest}"
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# xread [-n] MSG VAR
|
||||
#
|
||||
@ -324,10 +320,13 @@ pctCreate(){
|
||||
# pctCreate ID ARGS [PASS]
|
||||
#
|
||||
pctCreateAlpine(){
|
||||
local TEMPLATE
|
||||
getLatestTemplate alpine TEMPLATE
|
||||
if [ $DRY_RUN ] ; then
|
||||
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 upgrade
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user