Fix used memory on FreeBSD

This commit is contained in:
Dylan 2016-01-18 16:44:55 +11:00
parent 7f0ff292d2
commit ed9cbac233
1 changed files with 4 additions and 2 deletions

6
fetch
View File

@ -629,10 +629,12 @@ getmemory () {
*"BSD")
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
memused=$(top -d1 | awk '/Mem:/ {print $4}')
memtotal=${memtotal/\(/}
memtotal=${memtotal/)MB/}
memused=${memused/M/}
memfree=$(top -d1 | awk '/Mem:/ {print $10}')
memfree=${memfree/M/}
memused=$((memtotal - memfree))
memory="${memused}MB / ${memtotal}MB"
;;