From fd63a9dc9a1fcd64b8832b33027411f177b79165 Mon Sep 17 00:00:00 2001 From: slange-dev Date: Sat, 4 Jan 2025 21:06:49 +0100 Subject: [PATCH] Fix bug when checking whether vmstat exists [#14](https://github.com/samoshkin/tmux-plugin-sysstat/pull/14) --- scripts/cpu_collect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cpu_collect.sh b/scripts/cpu_collect.sh index 36ec6d8..87fd3ac 100755 --- a/scripts/cpu_collect.sh +++ b/scripts/cpu_collect.sh @@ -22,7 +22,7 @@ get_cpu_usage() { | sed -u -nr '/CPU usage/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*idle.*/\1/p' \ | gstdbuf -o0 awk '{ print 100-$0 }' fi - elif ! command_exists "vmstat"; then + elif command_exists "vmstat"; then if is_freebsd; then vmstat -n "$refresh_interval" -c "$samples_count" \ | stdbuf -o0 awk 'NR>2 {print 100-$(NF-0)}'