2021-04-06 18:25:06 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Print loadavg to stdout
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-10-07 08:43:32 +00:00
|
|
|
if [ "$(uname -s)" = "Darwin" ]; then
|
2023-11-23 07:36:28 +00:00
|
|
|
uptime | tr -d ',' | grep -o "[0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+"
|
2021-04-06 18:25:06 +00:00
|
|
|
else # Linux
|
|
|
|
cut -d " " -f 1-3 /proc/loadavg
|
|
|
|
fi
|