mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-17 21:52:56 +08:00
update 2026-08-05 21:55:04
This commit is contained in:
1 parent
58383ebb06
commit
e0753d55fd
1960 files changed
+9
-1523150
No files matched your search
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $(busybox ps -w | grep getcpu | grep -v grep | wc -l) -le 2 ]; then
|
||||
AT=$(cat /proc/stat | grep "^cpu " | awk '{print $2+$3+$4+$5+$6+$7+$8 " " $2+$3+$4+$7+$8}')
|
||||
sleep 1
|
||||
BT=$(cat /proc/stat | grep "^cpu " | awk '{print $2+$3+$4+$5+$6+$7+$8 " " $2+$3+$4+$7+$8}')
|
||||
printf "%.01f%%" $(echo $AT $BT | awk '{print (($4-$2)/($3-$1))*100}') >/tmp/cpuusage
|
||||
fi
|
||||
Reference in new issue
Block a user