#!/bin/sh
pida=`pgrep -f TextInputMenuAgent`
if [ $? -ne 0 ]
then
echo "TextInputMenuAgent is not runing....."
else
echo "TextInputMenuAgent is runing....."
echo $pida
for var in $pida
do
cpu=`ps -p $var -o pcpu|sed -n '2p'`
if [ $(echo "$cpu > 50.0" | bc) = 1 ]
then
Kill -9 $var
echo "删除TextInputMenuAgent进程:$var" >> kill.log
else
echo $var"没有超过cpu使用率50%"
fi
done
fi
pidb=`pgrep -f distnoted `
if [ $? -ne 0 ]
then
echo "distnoted is not runing....."
else
echo "distnoted is runing....."
echo $pidb
for var in $pidb
do
cpu=`ps -p $var -o pcpu|sed -n '2p'`
if [ $(echo "$cpu > 50.0" | bc) = 1 ]
then
Kill -9 $var
echo "删除distnoted进程:$var" >> kill.log
else
echo $var"没有超过cpu使用率50%"
fi
done
fi作者: Avndeoncj 时间: 2020-4-29 12:31
最简单的办法,重启就好了作者: ko1968 时间: 2020-4-29 12:31
附一个 睡眠解锁死机解决方案, 是由于升级系统导致电源管理出现问题的,百度以下如何重置电源管理方案.官方有教程.作者: AndreaSOr 时间: 2020-4-29 12:32
把系统输入法的中文手写取消就好了作者: d32962262 时间: 2020-4-29 12:33
楼主方法我一试就好了! 我还想请教一下为什么会出现如lz所陈述这样的cpu情况?