mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-14 08:01:35 +09:00
22 lines
283 B
Bash
22 lines
283 B
Bash
#!/bin/sh
|
|
cpu_usage=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
|
|
|
cpu_whole=`printf ${cpu_usage%.*}`
|
|
|
|
if [[ $cpuwhole -ge 80 ]]
|
|
then
|
|
true
|
|
#update var
|
|
elif [[ $cpuwhole -ge 70 ]]
|
|
then
|
|
true
|
|
#update var
|
|
else
|
|
true
|
|
#update var
|
|
fi;
|
|
|
|
echo $cpu_usage
|
|
|
|
|