summaryrefslogtreecommitdiffstats
path: root/client/shared/scripts/updateCache
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2013-09-10 12:24:29 +0000
committeririna <irinagomez@us.es>2013-09-10 12:24:29 +0000
commite24b042b02a201a4d241d4355ba463f1902e7d0e (patch)
tree59f33faf6e2d9beeea57b84924725c73f3b03130 /client/shared/scripts/updateCache
parent6adea3847917c014717a24034f41ff7d3921928d (diff)
#565 #564 cambio de extension las imagenes diferenciales a img.diff
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4039 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/scripts/updateCache')
-rwxr-xr-xclient/shared/scripts/updateCache19
1 files changed, 11 insertions, 8 deletions
diff --git a/client/shared/scripts/updateCache b/client/shared/scripts/updateCache
index f8de97c8..3c59d19e 100755
--- a/client/shared/scripts/updateCache
+++ b/client/shared/scripts/updateCache
@@ -200,13 +200,16 @@ case "$PROTOCOLO" in
USERRSYNC="opengnsys"
OPTRSYNC=" --delete --password-file=/scripts/passrsync "
[ "$ogcompress" == "true" ] && OPTRSYNC="z $OPTRSYNC"
- IMGEXT=${2##*.}
- DIRMOUNT="$(ogGetMountDir "${2%%.*}" $IMGEXT)"
+
+ [ "${2##*.}" == "img" ] && IMGTYPE="img" || IMGTYPE="diff"
+ IMGNAME="${2%.img*}"
+
+ DIRMOUNT="$(ogGetMountDir "$IMGNAME" $IMGTYPE)"
DIRLOCAL="/tmp/$DIRMOUNT"
mkdir $DIRLOCAL 2>/dev/null
echo "$MSG_SCRIPTS_UPDATECACHE_CHECKSIZEIMG"
-
+ # Si la imagen del repositorio es mayor, redimensiono la imagen de cache
if [ $CACHEFILESIZE -lt $REALFILESIZE ]; then
# Si la imagen esta montada la desmonto
mount |grep $CACHEFILE >/dev/null && umount $CACHEFILE
@@ -223,17 +226,17 @@ case "$PROTOCOLO" in
fi
# Montamos las imagenes para sincronizarlas
- ogMountImage CACHE "${2%%.*}" $IMGEXT >/dev/null
- ogMountImage REPO "${2%%.*}" $IMGEXT >/dev/null
+ ogMountImage CACHE "$IMGNAME" $IMGTYPE >/dev/null
+ ogMountImage REPO "$IMGNAME" $IMGTYPE >/dev/null
# Esperamos que se monte la imagen en el servidor
- ogWaitMountImage REPO "${2%%.*}" $IMGEXT
+ ogWaitMountImage REPO "$IMGNAME" $IMGTYPE
echo -e "\n rsync -aHAX OPTRSYNC --quiet $USERRSYNC@$REPOIP::ogimages/$DIRMOUNT/ $DIRLOCAL |tee -a $OGLOGSESSION $OGLOGFILE"
rsync -aHAX$OPTRSYNC --quiet $USERRSYNC@$REPOIP::ogimages/$DIRMOUNT/ $DIRLOCAL |tee -a $OGLOGSESSION $OGLOGFILE
# RETVAL="1" -> OK RETVAL="2" -> error # valores igual que ogUpdateCacheIsNecesary
[ $? == 0 ] && RETVAL="1"|| RETVAL="2"
# Desmonto las imagenes
- ogUnmountImage CACHE "${2%%.*}" $IMGEXT
- ogUnmountImage REPO "${2%%.*}" $IMGEXT
+ ogUnmountImage CACHE "$IMGNAME" $IMGTYPE
+ ogUnmountImage REPO "$IMGNAME" $IMGTYPE
;;
esac