summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngar <ingar@osirion.org>2016-03-25 23:51:59 +0100
committerIngar <ingar@osirion.org>2016-03-25 23:51:59 +0100
commitbf5cde89ca6dc435423b09c4cbe8467dc8526933 (patch)
treefa8ef8e3cde6b2917b70a4283a04db77486411cb
parent8a6954e39c5c0e706724b6b80e956ba854f17b37 (diff)
parente338075ca7992ece8d6a26be3fd59028420ce63a (diff)
Merge pull request #2 from illwieckz/master
better filesystem filtering for df
-rwxr-xr-xsysinfo.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/sysinfo.sh b/sysinfo.sh
index db7abdf..563e3f4 100755
--- a/sysinfo.sh
+++ b/sysinfo.sh
@@ -34,9 +34,7 @@ if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ]; then
fi
#---[ HD ] ----------------------------
-#sua=`df -l -x tmpfs -x devtmpfs | tail -n +1 | awk 'BEGIN {s=0; u=0; a=0;} {s=s+$2; u=u+$3; a=a+$4} END { s=s/1048576; u=u/1048576; a=a/1048576; printf "%d %d %d",s,u,a;}'`
-disk_fs=`cat /proc/filesystems | grep -v nodev | sed 's/\t//g' | xargs | sed 's/ /,/g'`
-sua=`df -l -x tmpfs -x devtmpfs -x devtmpfs --total | tail -n 1`
+sua=`grep 'nodev' '/proc/filesystems' | sed -e 's/nodev\t/-x /' | xargs df --local --total | tail -n 1`
disk_size=`echo $sua | awk '{printf "%d",$2/1048576;}'`;
disk_used=`echo $sua | awk '{printf "%d",$3/1048576;}'`;
disk_free=`echo $sua | awk '{printf "%d",$4/1048576;}'`;