memory: Fix crash on OpenBSD

This commit is contained in:
Dylan Araps 2017-12-26 07:38:11 +11:00
parent 21cc7bab93
commit dc929a6594
1 changed files with 4 additions and 1 deletions

View File

@ -1411,7 +1411,10 @@ get_memory() {
# Mem used. # Mem used.
case "$kernel_name" in case "$kernel_name" in
"OpenBSD"*) mem_used="$(($(vmstat | awk -F ' |M' 'END{printf $4}') / 1024))" ;; "OpenBSD"*)
mem_used="$(vmstat | awk 'END{printf $4}')"
mem_used="$((${mem_used/M} / 1024))"
;;
*) mem_used="$((mem_total - mem_free))" ;; *) mem_used="$((mem_total - mem_free))" ;;
esac esac
;; ;;