summaryrefslogtreecommitdiffstats
path: root/client/shared/scripts/deployImage
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-11-08 14:04:21 +0100
committerIrina Gómez <irinagomez@us.es>2019-11-08 14:04:21 +0100
commit0531169693dcd2e17bc158af5cf36584629e01ee (patch)
treec196c90c7dd1aefe7130c4b26b106048f6f338a7 /client/shared/scripts/deployImage
parent3df93abeaa9a24dcf9576606c515162fdb82b4a5 (diff)
#914 deployImagen shows error message when image file is corrupt or was created with other partclone version.
Diffstat (limited to 'client/shared/scripts/deployImage')
-rwxr-xr-xclient/shared/scripts/deployImage7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
index 9406d80e..d74d3ac2 100755
--- a/client/shared/scripts/deployImage
+++ b/client/shared/scripts/deployImage
@@ -98,7 +98,12 @@ fi
#Informacioin previa de la imagen
IMGOS=$(ogGetImageInfo `ogGetPath $MODE $IMGNAME.img`)
-[ -n "$IMGOS" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2"; echo $?)
+case $? in
+ 0) ;;
+ 1) ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2" || exit $? ;;
+ 5) ogRaiseError session $OG_ERR_IMAGEFILE "$REPO $2" || exit $? ;;
+ *) ogRaiseError session $OG_ERR_GENERIC || exit $? ;;
+esac
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"