Merge branch '2.6.0/master'

This commit is contained in:
Philippe Caseiro 2016-10-14 14:54:25 +02:00
commit 5c18a0b5f5

View File

@ -80,13 +80,7 @@ echo
#*****************************************************
if ! runOneCmd "oneimage" "show ${ISONAME}" &>/dev/null
then
echo "***** Téléchargement de ${ISONAME} *****"
wget --output-document "/tmp/eole-${VERSIONISO}-alternate-amd64.iso" ${ISOURL}
echo "***** Création de ${ISONAME} *****"
if [ $? -ne 0 ]; then
echo "Erreur lors du téléchargement, Abandon"
exit 1
fi
echo -ne "***** Création de l'image ${ISONAME} *****\n\n"
FILE=$(mktemp)
cat > ${FILE} <<EOF
@ -94,19 +88,27 @@ NAME="${ISONAME}"
TYPE="CDROM"
DESCRIPTION="${ISODESC}"
DEV_PREFIX="hd"
PATH="/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
PATH="${ISOURL}"
PERSISTENT="No"
EOF
runOneCmd "oneimage" "create -d $(CreoleGet one_ds_iso_name) ${FILE}"
/bin/rm -f ${FILE}
for i in `seq 60`
do
sleep 1
#oneimage show ${ISONAME} | grep STATE | grep rdy &>/dev/null && break
runOneCmd "oneimage" "show ${ISONAME}" | grep STATE | grep lock &>/dev/null || break
echo -n "Attente : "
runOneCmd "oneimage" "show ${ISONAME}" | grep STATE
done
spin='-\|/'
i=0
while :
do
imgState=$(runOneCmd "oneimage" "show ${ISONAME}" | awk '{if ($1 == "STATE") {print $3}}')
if [[ ${imgState} == "lock" ]]
then
i=$(( (i+1) %4 ))
printf "\rInitialisation en cours, merci de patienter [${spin:$i:1}] "
sleep 2
else
printf "\r Création terminée, l'image a le statut : ${imgState}\n"
break
fi
done
rm -f "/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
else
echo "***** ${ISONAME} existe déjà *****"