From 1286766428e5b32fed04fcaf6169a2831c0ec996 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Wed, 12 Jul 2023 20:20:40 -0700 Subject: sbin/fswarn: skip ramfs-as-file --- sbin/fswarn | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3