aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDavid Runge <david.runge@native-instruments.de>2018-04-23 08:41:33 +0200
committerDavid Runge <david.runge@native-instruments.de>2018-04-23 08:41:33 +0200
commit21c82ea77a7ab6ed9862eef7c604988995015cb5 (patch)
tree1e14b01d6eaee308a08ba812e2498afc3e902695 /bin
parent10b20223895f1b1bd154c96d96e55ad77291147b (diff)
downloaddotfiles-21c82ea77a7ab6ed9862eef7c604988995015cb5.tar.gz
dotfiles-21c82ea77a7ab6ed9862eef7c604988995015cb5.tar.bz2
dotfiles-21c82ea77a7ab6ed9862eef7c604988995015cb5.tar.xz
dotfiles-21c82ea77a7ab6ed9862eef7c604988995015cb5.zip
bin/get_load: Make script support macOS (needs different output parsing).
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get_load7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/get_load b/bin/get_load
index f409630..705c655 100755
--- a/bin/get_load
+++ b/bin/get_load
@@ -1,8 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
+uptime_output=""
-uptime_output=$(uptime| cut -d',' -f4,5,6|cut -d':' -f2)
+if [ "$(uname)" == "Darwin" ]; then
+ uptime_output=$(uptime| cut -d',' -f3| cut -d':' -f2)
+else
+ uptime_output=$(uptime| cut -d',' -f4,5,6|cut -d':' -f2)
+fi
uptime_output=${uptime_output#" "}
echo "$uptime_output"