summaryrefslogtreecommitdiffstats
path: root/admin/Sources
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2014-01-22 13:38:47 +0000
committeririna <irinagomez@us.es>2014-01-22 13:38:47 +0000
commit0109c07274d4a712f18c820466785f25b2d88c3c (patch)
treed5cb5f12c172da4d382829a1cfc4b230df327d75 /admin/Sources
parentd344ed8094aa522335155939d2be697f930547f9 (diff)
#565 se crean script: partclone2sync y clean-mountdirimage. Se controla el error al crear la imagen.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4119 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Sources')
-rwxr-xr-xadmin/Sources/Services/ogAdmRepoAux15
1 files changed, 13 insertions, 2 deletions
diff --git a/admin/Sources/Services/ogAdmRepoAux b/admin/Sources/Services/ogAdmRepoAux
index 1fc3e770..d6e5dac1 100755
--- a/admin/Sources/Services/ogAdmRepoAux
+++ b/admin/Sources/Services/ogAdmRepoAux
@@ -31,7 +31,12 @@ KERNEL=$(file $BASEDIR/tftpboot/ogclient/ogvmlinuz |awk -F . '{print $2}')
# AƱade registro de incidencias.
function echolog () {
- date +"%Y%m%d-%H%M%S $*" >> $REPOLOG
+ if [ "$1" == "-o" ]; then
+ shift
+ date +"%Y%m%d-%H%M%S $*"|tee -a $REPOLOG
+ else
+ date +"%Y%m%d-%H%M%S $*" >> $REPOLOG
+ fi
}
function mountImage () {
@@ -104,6 +109,7 @@ case "$PARM1" in
# Si existe la imagen hacemos copia de seguridad y la redimesionamos
if [ -f "$IMGFILE" ]; then
+ echolog "La imagen $IMGFILE ya existe."
# TODO modificar ogGetImageSize
IMGSIZE=$(ls -l --block-size=1024 $IMGFILE| cut -f5 -d" ")
@@ -161,7 +167,12 @@ case "$PARM1" in
fi
# Montamos la imagen.
mountImage "$IMGFILE" "$DIRMOUNT"
- [ "$?" == "0" ] || (echo salida=$?; echolog "Error al crear/redimensionar la imagen"; exit 1)
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ rmdir "$DIRMOUNT"
+ echolog -o "Error al crear/redimensionar la imagen"
+ exit $RETVAL
+ fi
touch "$DIRMOUNT/ogimg.info"
TIME2=$[SECONDS-TIME]