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