summaryrefslogtreecommitdiffstats
path: root/client/shared
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-05-15 11:16:31 +0200
committerIrina Gómez <irinagomez@us.es>2019-05-15 11:16:31 +0200
commitf097c21f1d1be5e6e396ba0687f237d8543ba076 (patch)
tree736d5bd7cc0a35581d758f38ac50c2edc329b7f8 /client/shared
parent04b15943a1c2000616da87528418cd96f28e70ff (diff)
Fix initCache: if the size of the cache changes, it always formats the cache. ogCheckFs includes the CACHE file system type
Diffstat (limited to 'client/shared')
-rwxr-xr-xclient/shared/scripts/initCache6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/shared/scripts/initCache b/client/shared/scripts/initCache
index 796ab84f..9caf0be0 100755
--- a/client/shared/scripts/initCache
+++ b/client/shared/scripts/initCache
@@ -69,6 +69,8 @@ else
ogUnmountCache 2>/dev/null
ogDeleteCache
fi
+ # Tomamos el tamaño actual. Si no existe cache será 0.
+ OLDSIZE=$(ogGetCacheSize 2>/dev/null) || OLDSIZE=0
# Error si tamaño definido no es >0.
if [ ! $SIZE -gt 0 ]; then
@@ -83,9 +85,9 @@ else
ogCreateCache $NDISK $NPART $SIZE
ogUpdatePartitionTable $NDISK
fi
- # Si caché no montada y no formateada, formatear.
+ # Si caché no montada y no formateada o cambia el tamaño: formatear.
CACHE=$(ogFindCache) || exit $?
- if ! ogIsFormated $CACHE; then
+ if ! ogIsFormated $CACHE || [ $SIZE -ne $OLDSIZE ]; then
echo "[50] Formatear caché local."
ogFormatCache
fi