Created
September 30, 2015 19:47
-
-
Save merovingian/ca69a91ed1e54e8df1cb to your computer and use it in GitHub Desktop.
Little Bash script to check the CPU load and kill Flashplayer if the load goes over a designated number. Useful for Linux VDI environments.
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/bash | |
# This little script kills the Flashplayer Plugin at | |
# a CPU load above N.* | |
# Fetch the average CPU load: | |
cpuload=$(cat /proc/loadavg | awk '{ print $1 }') | |
if [[ $cpuload = 5.* ]] | |
then $(pkill plugin-containe) # <- Yes without the r | |
fi | |
exit | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment