Fix tmpl download, min memory support

This commit is contained in:
thorstenspille 2023-02-10 18:13:45 +01:00
parent 395e0b71fa
commit 9b2d29257a

View File

@ -102,22 +102,18 @@ source "$config"
source "$PWD/src/$service/constants-service.conf" source "$PWD/src/$service/constants-service.conf"
if [ $LXC_MEM -lt $LXC_MEM_MIN ]; then
LXC_MEM=$LXC_MEM_MIN
fi
if [ $LXC_AUTOTAG -gt 0 ]; then if [ $LXC_AUTOTAG -gt 0 ]; then
TAGS="--tags ${LXC_TAGS},${SERVICE_TAGS}" TAGS="--tags ${LXC_TAGS},${SERVICE_TAGS}"
fi fi
# CHeck is the newest template available, else download it. # Check is the newest template available, else download it.
DEB_LOC=$(pveam list $LXC_TEMPLATE_STORAGE | grep $LXC_TEMPLATE_VERSION | tail -1 | cut -d'_' -f2) pveam update
DEB_REP=$(pveam available --section system | grep $LXC_TEMPLATE_VERSION | tail -1 | cut -d'_' -f2)
TMPL_NAME=$(pveam available --section system | grep $LXC_TEMPLATE_VERSION | tail -1 | cut -d' ' -f11) TMPL_NAME=$(pveam available --section system | grep $LXC_TEMPLATE_VERSION | tail -1 | cut -d' ' -f11)
pveam download $LXC_TEMPLATE_STORAGE $TMPL_NAME
if [[ $DEB_LOC == $DEB_REP ]];
then
echo "Newest Version of $LXC_TEMPLATE_VERSION $DEB_REP exists.";
else
echo "Will now download newest $LXC_TEMPLATE_VERSION $DEP_REP.";
pveam download $LXC_TEMPLATE_STORAGE $TMPL_NAME
fi
if [ $ctid -gt 99 ]; then if [ $ctid -gt 99 ]; then
LXC_CHK=$ctid LXC_CHK=$ctid