summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/fswarn1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/fswarn b/sbin/fswarn
index 82fe6df..278fcb7 100755
--- a/sbin/fswarn
+++ b/sbin/fswarn
@@ -18,6 +18,7 @@ STATETEMP=$(mktemp fswarn.XXXXXXXX)
for i in $( grep -E ' ('$( for FSTYPE in $( grep -v ^nodev /proc/filesystems ); do echo -n "$FSTYPE|"; done; echo -n "ramfs|tmpfs" )') ' /proc/mounts | cut -f 2 -d ' ' | sort -u ); do
BLOCKFREE=$( stat -f -c %a $i )
BLOCKTOTAL=$( stat -f -c %b $i )
+ [ $BLOCKTOTAL -eq 0 ] && continue # ramfs-as-file does this; skip it
BLOCKALLOC=$(( ${BLOCKTOTAL} - ${BLOCKFREE} ))
BLOCKPERCENT=$(( 100 * ${BLOCKALLOC} / ${BLOCKTOTAL} ))
BLOCKOLDPERCENT=$( grep "^${i} " ${STATEFILE} | cut -f 4 -d ' ' | grep . ) 2>/dev/null || BLOCKOLDPERCENT=0