summaryrefslogtreecommitdiffstats
path: root/client/shared/scripts/createImage
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2014-08-21 11:48:03 +0000
committerramon <ramongomez@us.es>2014-08-21 11:48:03 +0000
commitb9797f231348ec75500a7decd6b0e5dd4f8cb833 (patch)
treece7b6d6509b3f5c2c3d72a430e673a95b68a6979 /client/shared/scripts/createImage
parentc26ed4c8c34771b0343fcb4d2ec4fb4b9509bd17 (diff)
versión 1.0.6: Corregidas erratas leves en script {{{createImage}}} al comparar el parámetro repositorio y al personalizar la extensión del fichero de imagen.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4367 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/scripts/createImage')
-rwxr-xr-xclient/shared/scripts/createImage12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/shared/scripts/createImage b/client/shared/scripts/createImage
index df98ec5b..50ef1768 100755
--- a/client/shared/scripts/createImage
+++ b/client/shared/scripts/createImage
@@ -53,7 +53,7 @@ TIME1=$SECONDS
# Valores por defecto en etc/engine.cfg
#IMGPROG="partclone"
#IMGCOMP="lzop"
-#IMGEXT="img"
+IMGEXT=${IMGEXT:-"img"}
#IMGREDUCE="TRUE"
# Clear temporary file used as log track by httpdlog
@@ -63,7 +63,7 @@ echo " " > $OGLOGSESSION; echo " " > $OGLOGCOMMAND; echo " " > ${OGLOGCOMMAND}.t
ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*"
# Si el repositorio es CACHE comprobamos que exista
-if [ "$3" == "CACHE" -o "$3" == "cache" ]; then
+if [ "${3^^}" == "CACHE" ]; then
! ogFindCache >/dev/null && exit $(ogRaiseError $OG_ERR_NOTCACHE "CACHE "; echo $?)
fi
@@ -101,8 +101,8 @@ then
FACTORLZOP=65/100
let SIZEREQUIRED=$SIZEDATA*$FACTORLZOP
#Comprobar espacio libre en el contenedor.
- [ "$3" == "CACHE" ] && SIZEFREE=$(ogGetFreeSize `ogFindCache`)
- [ "$3" == "REPO" ] && SIZEFREE=$(df -k | grep $OGIMG | awk '{print $4}')
+ [ "${3^^}" == "CACHE" ] && SIZEFREE=$(ogGetFreeSize `ogFindCache`)
+ [ "${3^^}" == "REPO" ] && SIZEFREE=$(df -k | grep $OGIMG | awk '{print $4}')
else
ogRaiseError $OG_ERR_PARTITION "$1 $2"
exit $?
@@ -154,8 +154,8 @@ ogEcho log session " $MSG_HELP_ogExtendFs $NEWSIZEFS -> $SIZEFS = $SIZEFS
#TODO que hacer si error al extender sistemade archivos
#resumen de la operacion
-IMGSIZE=$(ls -s `ogGetPath $3 /$4.img`| cut -f1 -d" ")
-IMGOS=$(ogGetImageInfo `ogGetPath $3 /$4.img`)
+IMGSIZE=$(ls -s `ogGetPath $3 /$4.$IMGEXT`| cut -f1 -d" ")
+IMGOS=$(ogGetImageInfo `ogGetPath $3 /$4.$IMGEXT`)
TIME=$[SECONDS-TIME1]
ogEcho log session "[100] $MSG_SCRIPTS_TIME_TOTAL $[TIME/60]m $[TIME%60]s"