Init ONE: download latest ISO point release

* postservice/99-init-hapy-master: use “eole-iso” to retrieve informations.

Ref: #25055
This commit is contained in:
Daniel Dehennin 2018-09-21 09:04:58 +02:00
parent 6f190b5dcd
commit 233afaaf94

View File

@ -33,18 +33,26 @@ function runOneCmd()
return ${?}
}
if [ $(CreoleGet activer_proxy_client 'non') = 'oui' ]
then
PROXY_SERVER=$(CreoleGet proxy_client_adresse)
PROXY_PORT=$(CreoleGet proxy_client_port)
PROXY_OPT="--proxy http://${PROXY_SERVER}:${PROXY_PORT}"
fi
DISKSIZE=$(CreoleGet hapy_init_master_disk_size)
DISKNAME="DSK-${DISKSIZE}-Go"
DISKDESC="Disque vide de ${DISKSIZE} Go"
VERSIONISO=$(CreoleGet hapy_init_master_iso_version)
MAJORVERSION=${VERSIONISO:0:3}
ISONAME="ISO-Eole-${VERSIONISO}-amd64"
ISODESC="Image ISO EOLE Stable ${VERSIONISO} 64 bits"
ISOURL="http://eole.ac-dijon.fr/pub/iso/EOLE-${MAJORVERSION}/${VERSIONISO}/eole-${VERSIONISO}-alternate-amd64.iso"
POINT_RELEASE=$(eole-iso ${PROXY_OPT} --release ${VERSIONISO} get-last-point-release)
ISONAME=$(eole-iso ${PROXY_OPT} --release ${VERSIONISO} get-iso-name)
ISODESC="Image ISO EOLE ${POINT_RELEASE} 64 bits"
ISOURL=$(eole-iso ${PROXY_OPT} --release ${VERSIONISO} get-iso-url)
TMPLNAME="InstallEole-${VERSIONISO}-amd64"
TMPLDESC="Modèle de VM permettant d'installer un module EOLE ${VERSIONISO} 64 bits (non persistente)"
TMPLNAME="install-eole-${POINT_RELEASE}-amd64"
TMPLDESC="Modèle de VM permettant d'installer un module EOLE ${POINT_RELEASE} 64 bits (non persistente)"
#echo "########### suppr ${DISKNAME} ###############"
#oneimage delete ${DISKNAME}
@ -109,7 +117,7 @@ EOF
break
fi
done
rm -f "/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
rm -f "/tmp/${ISONAME}"
else
echo "***** ${ISONAME} existe déjà *****"
fi