summaryrefslogtreecommitdiff
path: root/bin/common
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common')
-rwxr-xr-xbin/common/saf11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/common/saf b/bin/common/saf
index 0c6fbc4..dcc43d5 100755
--- a/bin/common/saf
+++ b/bin/common/saf
@@ -7,6 +7,15 @@ green="$(printf '\033[32m')"
blue="$(printf '\033[34m')"
reset="$(printf '\033[0m')"
+load ()
+{
+ for time in $(uptime | cut -f3- -d',' | cut -f2 -d':' | tr ',' ' ')
+ do
+ percent="$(echo "$time*100/$(nproc)" | bc)"
+ echo "${percent:-0}%"
+ done | xargs
+}
+
for file in /etc/os-release /usr/lib/os-release
do
[ -f "$file" ] && . "$file" && break
@@ -19,6 +28,6 @@ SHELL="$(basename "$SHELL")"
cat <<EOF
${red}- ${blue}${ID:-"unknown"}
${red}- ${blue}$KERNEL
- ${red}- ${blue}$UPTIME
+ ${red}- ${blue}$UPTIME ($(load))
${red}- ${blue}$SHELL${reset}
EOF