#!/bin/bash
# This script is used to kill progress which having abnormal occupancy rate of CPU,
# I want through this way to protect my server from the hacker who attempting to use my server to mining.
# The method is capture PID which progress' occupancy rate of CPU greater than 90% by awk,then kill these PID.
while true;do
for i in `ps aux | awk '{if($3 > 90){print $2}}'`;do
kill -9 $i
done
done