dot

packages and services management
Log | Files | Refs | README

commit 925b18dadd350521e1eca74a7ebec94f04c56894
parent 5ecdad359088baa923b346dd27674c8e9ccb6a9c
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Fri, 23 Jun 2017 18:55:57 +0200

load average on BSDs

Diffstat:
MSERVICE | 2+-
Mbin/status | 6++----
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/SERVICE b/SERVICE @@ -39,7 +39,7 @@ do if [ "$cmd" = stop ] || [ "$cmd" = restart ] then kill -14 "$pid" && - printf '%-15s [stoping] %s\n' "$srv" "$cmdline" + printf '%-15s [stopped] %s\n' "$srv" "$cmdline" else run=1 printf '%-15s [running] %s\n' "$srv" "$cmdline" diff --git a/bin/status b/bin/status @@ -13,7 +13,7 @@ status_mail() { if [ -d "$MAIL/new" ] then - mail="$(find "$MAIL/new" -type f | wc -l)" + mail="$(find "$MAIL/new" -type f | wc -l | tr -d '\t ')" mail="${mail#0}" mail="${mail:+$mail mail}" @@ -30,9 +30,7 @@ status_date() status_cpu() { - read -r latest_1 latest_5 latest_15 trailing < /proc/loadavg - - printf '%s' "$latest_1" # "$latest_5" "$latest_15" + uptime | sed -r 's/.*load averages: ([^,]*).*/\1/' }