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 #