Guest User

Untitled

a guest
May 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. PERC=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}');
  4.  
  5. if [[ "$PERC" -gt 50 ]]
  6. then
  7. echo 'high load';
  8. else
  9. echo 'normal load';
  10. fi
Add Comment
Please, Sign In to add comment