Read a filesystem once where two probes were answering the same question

This commit is contained in:
Gmer4Lfe
2026-08-24 18:46:26 -04:00
parent 9da2760a42
commit b58282b3d6
4 changed files with 23 additions and 14 deletions
+5 -3
View File
@@ -154,9 +154,11 @@ if [[ "$SHOW_STATUS" == true ]]; then
echo ""
if mountpoint -q "$RAMDISK_PATH" 2>/dev/null; then
USAGE=$(df -BG "$RAMDISK_PATH" | awk 'NR==2 {print $3}')
AVAIL=$(df -BG "$RAMDISK_PATH" | awk 'NR==2 {print $4}')
echo " $ICON_RAM Ramdisk: mounted — $USAGE used / $AVAIL available ✅"
if read -r _ USED_MB AVAIL_MB <<< "$(disk_df "$RAMDISK_PATH")" && [[ -n "$AVAIL_MB" ]]; then
echo " $ICON_RAM Ramdisk: mounted — $(format_mb "$USED_MB") used / $(format_mb "$AVAIL_MB") available ✅"
else
echo " $ICON_RAM Ramdisk: mounted — size unreadable"
fi
FILE_COUNT=$(find "$RAMDISK_PATH" -type f 2>/dev/null | wc -l)
echo " $ICON_RAM Active files on ramdisk: $FILE_COUNT"
else