Update 2022-12-05 17:03 Linux/x86_64
This commit is contained in:
parent
4ad2e85880
commit
e5a3d424cc
@ -1,7 +1,20 @@
|
|||||||
#!/bin/ksh
|
#!/bin/ksh
|
||||||
|
|
||||||
out() { printf '%s/1000/1000\n' "$1" | bc; }
|
linux_server() {
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
printf " %s %3s%% %s°C %s (priv) %4sMhz \n" \
|
||||||
|
"$(who | cut -d" " -f1 | sort -u | wc -l)" \
|
||||||
|
"$(ps -u d034266 -o pcpu | awk '/[0-9\.]/ { s=s+$1 } END { printf("%.0d\n", s); }')" \
|
||||||
|
"$(sensors | awk '/^Core/ { s=$3+s } END { printf("%2d\n", s/60); }')" \
|
||||||
|
"$(df -h --output=avail /priv/ | tail -1)" \
|
||||||
|
"$(lscpu | awk '/^CPU MHz:/ { printf("%.4d", $3) }')"
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
openbsd_laptop() {
|
||||||
|
out() { printf '%s/1000/1000\n' "$1" | bc; }
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
set -A _SYSV -- $(sysctl -n hw.sensors.cpu0.temp0 \
|
set -A _SYSV -- $(sysctl -n hw.sensors.cpu0.temp0 \
|
||||||
@ -18,3 +31,10 @@ do
|
|||||||
"$(apm -l)" "${_SYSV[0]}" "${_SYSV[1]}" "${_SYSV[2]}" "$(out $AVG)";
|
"$(apm -l)" "${_SYSV[0]}" "${_SYSV[1]}" "${_SYSV[2]}" "$(out $AVG)";
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
case $(hostname) in
|
||||||
|
ld*) linux_server; ;;
|
||||||
|
*.home.codevoid.de) openbsd_laptop; ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user