Skip to content

Instantly share code, notes, and snippets.

@merovingian
Created September 30, 2015 19:47
Show Gist options
  • Save merovingian/ca69a91ed1e54e8df1cb to your computer and use it in GitHub Desktop.
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.
#! /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