summaryrefslogtreecommitdiffstats
path: root/client/engine/Image.lib
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-10-11 08:58:38 +0000
committerramon <ramongomez@us.es>2017-10-11 08:58:38 +0000
commit3b43d89df4ecaf682fdb4eff42d42fafc70c1857 (patch)
tree383d9b7228f55849f62aa355bc823fa11a38bd5f /client/engine/Image.lib
parentb444fa7a93141dbca20f70ef069a783dc57109ef (diff)
#810: Generar fichero .info tras crear imagen.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5454 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/Image.lib')
-rwxr-xr-xclient/engine/Image.lib13
1 files changed, 8 insertions, 5 deletions
diff --git a/client/engine/Image.lib b/client/engine/Image.lib
index 71c1e299..f9089404 100755
--- a/client/engine/Image.lib
+++ b/client/engine/Image.lib
@@ -273,9 +273,11 @@ ogLockImage "$2" "$3.$IMGTYPE" || return $?
trap "ogUnlockDisk $1; ogUnlockImage "$3" "$4.$IMGTYPE"; rm -f $IMGFILE" 1 2 3 6 9
eval $PROGRAM
-# Controlar salida de error y desbloquear partición.
+# Controlar salida de error, crear fichero de información y desbloquear partición.
ERRCODE=$?
-if [ $ERRCODE != 0 ]; then
+if [ $ERRCODE == 0 ]; then
+ echo "$(ogGetImageInfo $IMGFILE):$(ogGetHostname)" > $IMGFILE.info
+else
ogRaiseError $OG_ERR_IMAGE "$1 $2 $IMGFILE"
rm -f "$IMGFILE"
fi
@@ -286,7 +288,6 @@ return $ERRCODE
}
-
#/**
# ogCreateImage int_ndisk int_npartition str_repo path_image [str_tools] [str_compressionlevel]
#@brief Crea una imagen a partir de una partición.
@@ -357,9 +358,11 @@ ogLockImage "$3" "$4.$IMGTYPE" || return $?
trap "ogUnlock $1 $2; ogUnlockImage "$3" "$4.$IMGTYPE"; rm -f $IMGFILE" 1 2 3 6 9
eval $PROGRAM
-# Controlar salida de error y desbloquear partición.
+# Controlar salida de error, crear fichero de información y desbloquear partición.
ERRCODE=$?
-if [ $ERRCODE != 0 ]; then
+if [ $ERRCODE == 0 ]; then
+ echo "$(ogGetImageInfo $IMGFILE):$(ogGetHostname)" > $IMGFILE.info
+else
ogRaiseError $OG_ERR_IMAGE "$1 $2 $IMGFILE"
rm -f "$IMGFILE"
fi