summaryrefslogtreecommitdiffstats
path: root/client/shared/scripts/deployImage
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2014-03-04 13:07:35 +0000
committeririna <irinagomez@us.es>2014-03-04 13:07:35 +0000
commit30ad471609a53482410d51b66f0c9f764c2e944a (patch)
treefdd9c2b594b417e399b86d509c874ed2f0608789 /client/shared/scripts/deployImage
parent46f7d6f1ff72d67b3aa2963400353678790b18ef (diff)
#565 #636 revisiĆ³n mensajes de error en las sincronizadas.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4173 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/scripts/deployImage')
-rwxr-xr-xclient/shared/scripts/deployImage21
1 files changed, 9 insertions, 12 deletions
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
index 6c06b539..7c3030a0 100755
--- a/client/shared/scripts/deployImage
+++ b/client/shared/scripts/deployImage
@@ -68,10 +68,7 @@ echo " " > $OGLOGCOMMAND
echo "[1] $MSG_SCRIPTS_START $0 $*" | tee -a $OGLOGSESSION $OGLOGFILE
# Si el origen(pariticion) esta bloqueada salir.
-if ogIsLocked $DISK $PART; then
- ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION, $DISK $PART"
- exit $?
-fi
+ogIsLocked $DISK $PART && exit $(ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION, $DISK $PART"; echo $?)
echo "Desmontando $DISK $PART" | tee -a $OGLOGSESSION $OGLOGFILE
ogUnmount $DISK $PART 2>/dev/null
@@ -81,7 +78,7 @@ ogUnmount $DISK $PART 2>/dev/null
[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE"
#Informacioin previa de la imagen
-IMGOS=$(ogGetImageInfo `ogGetPath $REPO $IMGNAME.img`) || exit $(echo "ERROR: $OG_ERR_NOTFOUND $MSG_ERR_NOTFOUND, IMAGEN $REPO $3" | tee -a $OGLOGSESSION $OGLOGFILE; ogRaiseError $OG_ERR_NOTFOUND "$MSG_ERR_NOTFOUND, $REPO $3"; echo $?)
+IMGOS=$(ogGetImageInfo `ogGetPath $REPO $IMGNAME.img`) || exit $(ogRaiseError $OG_ERR_NOTFOUND "$REPO $3"; echo $?)
IMGSIZE=$(ls -s `ogGetPath $REPO $IMGNAME.img`| cut -f1 -d" ")
echo "[1] REPO=$REPO IMG-FILE=$IMGNAME.img SIZE=$IMGSIZE (KB) METADATA=$IMGOS" | tee -a $OGLOGSESSION $OGLOGFILE
@@ -129,14 +126,14 @@ case "$REPO" in
esac
;;
*) # Error: protocolo desconocido.
- ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $PROTO" | tee -a $OGLOGSESSION $OGLOGFILE
+ ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $PROTO"
exit $?
;;
esac
;;
*) # Error: repositorio desconocido.
- ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $REPO" 2>&1 | tee -a $OGLOGSESSION $OGLOGFILE
- exit ${PIPESTATUS[0]}
+ ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT, $REPO"
+ exit $?
;;
esac
@@ -146,24 +143,24 @@ case "$NEXTOPERATION" in
CACHE)
echo "[55] $MSG_HELP_ogRestoreImage : restoreImage CACHE $IMGNAME $DISK $PART UNICAST" | tee -a $OGLOGSESSION $OGLOGFILE
restoreImage CACHE "$IMGNAME" "$DISK" "$PART"
- RETVAL=${PIPESTATUS[0]}
+ RETVAL=$0
;;
UNICAST)
echo "[55] $MSG_HELP_ogRestoreImage : restoreImage REPO $IMGNAME $DISK $PART UNICAST" | tee -a $OGLOGSESSION $OGLOGFILE
restoreImage REPO "$IMGNAME" "$DISK" "$PART"
- RETVAL=${PIPESTATUS[0]}
+ RETVAL=$0
;;
MULTICAST)
echo "[55] $MSG_HELP_ogRestoreImage : restoreImage REPO $IMGNAME $DISK $PART $PROTO $PROTOOPT" | tee -a $OGLOGSESSION $OGLOGFILE
restoreImage REPO "$IMGNAME" "$DISK" "$PART" $PROTO $PROTOOPT
- RETVAL=${PIPESTATUS[0]}
+ RETVAL=$0
;;
esac
RESUMERESTOREIMAGE=$(grep -m 1 "Total Time:" $OGLOGCOMMAND)
echo " [ ] $RESUMERESTOREIMAGE " | tee -a $OGLOGSESSION $OGLOGFILE
# Si la transferencia ha dado error me salgo.
if [ $RETVAL -ne 0 ] ; then
- ogRaiseError $OG_ERR_IMAGE "$REPO $IMGNAME" 2>&1 | tee -a $OGLOGSESSION $OGLOGFILE
+ ogRaiseError $OG_ERR_IMAGE "$REPO $IMGNAME" 2>&1
# Muestro registro de fin de ejecuciĆ³n si no viene de Ejecutar Script
[ "$(ogGetCaller)" == "EjecutarScript" ] || echo "$MSG_INTERFACE_END $OG_ERR_IMAGE" | tee -a $OGLOGSESSION $OGLOGFILE
exit $OG_ERR_IMAGE