summaryrefslogtreecommitdiffstats
path: root/client/shared/scripts
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2017-07-26 11:44:53 +0000
committeririna <irinagomez@us.es>2017-07-26 11:44:53 +0000
commit6934ad12ffcea46bbb1cda8278371b54ee51dce6 (patch)
tree34a2efe551b365f00805c31bfd0498e9e3bb11e9 /client/shared/scripts
parentb2d7943261a0fd6e040354c8a62408f2741ce880 (diff)
#797 deployImage: Muestra informaciĆ³n de la imagen en los archivos de log.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5412 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/scripts')
-rwxr-xr-xclient/shared/scripts/deployImage23
1 files changed, 15 insertions, 8 deletions
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
index 88e990fe..51847110 100755
--- a/client/shared/scripts/deployImage
+++ b/client/shared/scripts/deployImage
@@ -63,6 +63,8 @@ PART="$4"
PROTO="${5^^}"
PROTO="${PROTO:-"UNICAST"}"
PROTOOPT="$6"
+# Unidad organizativa.
+[ "$ogunit" != "" ] && OGUNIT="$ogunit"
#Load engine configurator from engine.cfg file.
#Carga el configurador del engine desde el fichero engine.cfg
@@ -83,17 +85,22 @@ ogEcho log session "$MSG_HELP_ogUnmount $DISK $PART"
ogUnmount $DISK $PART 2>/dev/null
# Valor por defecto para el repositorio.
-ogCheckIpAddress "$REPO"
-[ $? == 0 -o "$REPO" == "REPO" ] && MODE="REPO"
-[ "$REPO" == "$(ogGetIpAddress)" -o "$REPO" == "CACHE" ] && MODE="CACHE"
+if [ "$REPO" == "$(ogGetIpAddress)" -o "$REPO" == "CACHE" ]; then
+ MODE="CACHE"
+else
+ ogCheckIpAddress "$REPO"
+ if [ $? == 0 -o "$REPO" == "REPO" ]; then
+ # Si falla el cambio -> salimos con error repositorio no valido
+ ogChangeRepo $REPO ${OGUNIT} || exit $(ogRaiseError $OG_ERR_NOTFOUND "$REPO $OGUNIT"; echo $?)
+ MODE="REPO"
+ fi
+fi
-# Se comenta lo siguiente porque no se puede obtener antes de cambiar de repositorio
-# Solo informativo, se comprueba en updateCache y restoreImage
#Informacioin previa de la imagen
-#IMGOS=$(ogGetImageInfo `ogGetPath $REPO $IMGNAME.img`) || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2"; echo $?)
-#IMGSIZE=$(ls -s `ogGetPath $REPO $IMGNAME.img`| cut -f1 -d" ")
+IMGOS=$(ogGetImageInfo `ogGetPath $MODE $IMGNAME.img`) || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2"; echo $?)
+IMGSIZE=$(ls -s `ogGetPath $MODE $IMGNAME.img`| cut -f1 -d" ")
-#ogEcho log session "[1] REPO=$REPO IMG-FILE=$IMGNAME.img SIZE=$IMGSIZE (KB) METADATA=$IMGOS"
+ogEcho log session "[1] REPO=$REPO IMG-FILE=$IMGNAME.img SIZE=$IMGSIZE (KB) METADATA=$IMGOS"
# Procesar repositorio.
case "$MODE" in