diff options
author | irina <irinagomez@us.es> | 2013-05-23 12:11:07 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2013-05-23 12:11:07 +0000 |
commit | 83619749ec962508cd895470c07cd58cc67d4027 (patch) | |
tree | 3913d52bb1e96d67e86853e23b40f3bbcaf633f7 /admin/Sources/Services/ogAdmRepoAux | |
parent | 5ccac26686fad8051391c1785b30408db070a4e8 (diff) |
#565 comandos para manipular las imagenes sincronizadas desde el servidor
git-svn-id: https://opengnsys.es/svn/branches/version1.0@3817 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Sources/Services/ogAdmRepoAux')
-rwxr-xr-x | admin/Sources/Services/ogAdmRepoAux | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/admin/Sources/Services/ogAdmRepoAux b/admin/Sources/Services/ogAdmRepoAux index b26773a6..e1d40406 100755 --- a/admin/Sources/Services/ogAdmRepoAux +++ b/admin/Sources/Services/ogAdmRepoAux @@ -67,10 +67,9 @@ case "$PARM1" in MOUNTDIR="$REPODIR/mount/${PARM2}" [ "$IMGEXT" == "diff" ] && MOUNTDIR="$MOUNTDIR.$IMGEXT" + mkdir -p "$MOUNTDIR" - # Aumentamos El tamaño por el error de rsycn -> Probar con menos tamaño SIZEREQUIRED="$PARM4" - #let SIZEREQUIRED=$PARM4*4/3 if [ -f "$IMGFILE" ]; then echolog "Redimensionamos la imagen $IMGFILE al tamaño necesario: $SIZEREQUIRED" @@ -117,15 +116,14 @@ case "$PARM1" in fi # Montamos la imagen. - mkdir -p "$MOUNTDIR" echolog "mount -o compress=lzo $IMGFILE $MOUNTDIR" mount -o compress=lzo "$IMGFILE" "$MOUNTDIR" [ "$?" == "0" -o "$?" == "32" ] || (echolog "Error al crear/redimensionar la imagen"; exit 1) touch "$MOUNTDIR/ogimg.info" TIME2=$[SECONDS-TIME] echolog "Fin creación/redimension de la imagen: $[TIME2/60]m $[TIME2%60]s" - echo losetup -d $LOOPDEVICE - losetup -d $LOOPDEVICE + # Si existe dispositivo loop lo borramos. + [ $LOOPDEVICE ] && losetup -d $LOOPDEVICE # TODO: comprobar que no se quede el losetup bloqueado. ;; @@ -151,8 +149,9 @@ case "$PARM1" in IMGEXT="$PARM3" MOUNTDIR="$REPODIR/mount/$PARM2" [ "$IMGEXT" == "diff" ] && MOUNTDIR="$MOUNTDIR.$IMGEXT" - echolog "Desmontamos la imagen $IMGFILE " + echolog "Desmontamos la imagen $PARM2 $PARM3 " umount $MOUNTDIR + rmdir $MOUNTDIR ;; REDUCE_IMAGE) @@ -162,7 +161,7 @@ case "$PARM1" in #3 Extensión [ img |diff ] IMGEXT="$PARM3" IMGFILE="$REPODIR$PARM2.$IMGEXT" - [ ! -f $IMGFILE ] && echolog "Imagen no existe" && exit 1 + [ ! -f $IMGFILE ] && echolog "Imagen $IMGFILE no existe" && exit 1 MOUNTDIR="$REPODIR""mount/${PARM2}" [ "$IMGEXT" == "diff" ] && MOUNTDIR="$MOUNTDIR.$IMGEXT" |