Created
June 28, 2012 13:03
-
-
Save vertrigo/3011257 to your computer and use it in GitHub Desktop.
gnome-antifreeze-control-script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| while test 1 | |
| do | |
| LOAD=`ps axo pcpu,fname,stat | grep gnome-sh | grep Rl |awk '{s=s+$1} END {print (s)}'|awk '{ split($0, n, "."); print n[1] + (substr(n[2], 1, 1) >= 5 ? 1 : 0) }'` | |
| OUTPUT=`ps -e|grep gnome-shell|grep -v grep` | |
| if [ $LOAD -gt "90" ] ; then | |
| echo Freeze... | |
| killall --signal SIGKILL gnome-shell | |
| else if echo $OUTPUT | grep gnome-shell>/dev/null ; then | |
| echo All right. | |
| fi | |
| fi | |
| sleep 5 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment