From 881eea145f8393c17cb0b18f4b6113cf1a1cc96d Mon Sep 17 00:00:00 2001 From: Azlux Date: Thu, 7 May 2020 11:52:44 +0200 Subject: [PATCH] add size check for zram fix #99 --- log2ram | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/log2ram b/log2ram index a4e6ebd..42569ba 100755 --- a/log2ram +++ b/log2ram @@ -23,7 +23,12 @@ syncToDisk () { syncFromDisk () { isSafe - if [ ! -z "$(du -sh -t "$SIZE" $HDD_LOG/ | cut -f1)" ]; then + TP_SIZE=$SIZE + if [ "$ZL2R" = true ]; then + TP_SIZE=$LOG_DISK_SIZE + then + + if [ ! -z "$(du -sh -t "$TP_SIZE" $HDD_LOG/ | cut -f1)" ]; then echo "ERROR: RAM disk for "$HDD_LOG/" too small. Can't sync." umount -l $RAM_LOG/ umount -l $HDD_LOG/