diff options
author | David Runge <david.runge@native-instruments.de> | 2018-04-23 08:41:33 +0200 |
---|---|---|
committer | David Runge <david.runge@native-instruments.de> | 2018-04-23 08:41:33 +0200 |
commit | 21c82ea77a7ab6ed9862eef7c604988995015cb5 (patch) | |
tree | 1e14b01d6eaee308a08ba812e2498afc3e902695 /bin/get_load | |
parent | 10b20223895f1b1bd154c96d96e55ad77291147b (diff) | |
download | dotfiles-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/get_load')
-rwxr-xr-x | bin/get_load | 7 |
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" |