Fixed memory usage on OpenBSD
This commit is contained in:
parent
ed9cbac233
commit
b01f0eb22f
16
fetch
16
fetch
|
@ -472,7 +472,6 @@ getpackages () {
|
||||||
|
|
||||||
"FreeBSD")
|
"FreeBSD")
|
||||||
packages=$(pkg info | wc -l)
|
packages=$(pkg info | wc -l)
|
||||||
packages=${packages// }
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*"BSD")
|
*"BSD")
|
||||||
|
@ -487,6 +486,8 @@ getpackages () {
|
||||||
packages="Unknown"
|
packages="Unknown"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
packages=${packages// }
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get shell
|
# Get shell
|
||||||
|
@ -627,11 +628,22 @@ getmemory () {
|
||||||
memory="${memused}MB / ${memtotal}MB"
|
memory="${memused}MB / ${memtotal}MB"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"FreeBSD")
|
||||||
|
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
|
||||||
|
memtotal=${memtotal/\(/}
|
||||||
|
memtotal=${memtotal/)MB/}
|
||||||
|
memfree=$(top -d 1 | awk '/Mem:/ {print $10}')
|
||||||
|
memfree=${memfree/M/}
|
||||||
|
memused=$((memtotal - memfree))
|
||||||
|
|
||||||
|
memory="${memused}MB / ${memtotal}MB"
|
||||||
|
;;
|
||||||
|
|
||||||
*"BSD")
|
*"BSD")
|
||||||
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
|
memtotal=$(dmesg | awk '/real mem/ {printf $5}')
|
||||||
memtotal=${memtotal/\(/}
|
memtotal=${memtotal/\(/}
|
||||||
memtotal=${memtotal/)MB/}
|
memtotal=${memtotal/)MB/}
|
||||||
memfree=$(top -d1 | awk '/Mem:/ {print $10}')
|
memfree=$(top -d 1 | awk '/Real:/ {print $4}')
|
||||||
memfree=${memfree/M/}
|
memfree=${memfree/M/}
|
||||||
memused=$((memtotal - memfree))
|
memused=$((memtotal - memfree))
|
||||||
|
|
||||||
|
|
Reference in New Issue