Merge pull request #12 from daenney/patch-1

cpu_percentage: Fix multiple HDD on OS X
This commit is contained in:
Camille TJHOA 2016-03-08 19:26:58 +01:00
commit 21bb555e6f

View file

@ -10,7 +10,7 @@ print_cpu_percentage() {
if is_linux_iostat; then
iostat -c 1 2 | tail -n 2 | tr -s ' ' ';' | grep -e '^;' | cut -d ';' -f 7 | awk '{usage=100-$1} END {printf("%5.1f%%", usage)}'
elif is_osx; then
iostat -c 2 | tail -n 1 | tr -s ' ' ';' | cut -d ';' -f 7 | awk '{usage=100-$1} END {printf("%5.1f%%", usage)}'
iostat -c 2 disk0 | tail -n 1 | tr -s ' ' ';' | cut -d ';' -f 7 | awk '{usage=100-$1} END {printf("%5.1f%%", usage)}'
elif is_freebsd; then
iostat -c 2 | tail -n 1 | tr -s ' ' ';' | cut -d ';' -f 11 | awk '{usage=100-$1} END {printf("%5.1f%%", usage)}'
else