diff options
Diffstat (limited to 'bin')
-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" |