From d3f15fbffd2904f07bb79669180d556aa041e51f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 4 Jan 2024 16:15:12 +0300 Subject: [PATCH] working on basic template management... Signed-off-by: Alex A. Naanou --- .pct-helpers | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.pct-helpers b/.pct-helpers index 564c309..35c24e1 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -141,6 +141,21 @@ normpath(){ #---------------------------------------------------------------------- +# +# getLatestTemplate PATTERN [VAR] +# +getLatestTemplate(){ + local pattern=$1 + local tamplates=($(pveam available | grep $1)) + local latest=${templates[-1]} + + pvaem download local ${latest} + + [ -z $2 ] \ + || eval "$2=${latest}" +} + + # # xread [-n] MSG VAR #