nam3nL0s

end - End Now Dead process

Aug 17th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #   --------[ END - End Now Dead(process) ]--------
  4. #
  5. # Uccide con SIGKILL (-9) il processo che occupa piu' CPU
  6. # Utile per terminare al volo processi zombie
  7.  
  8. a=$(ps aux | awk '{print $2, $3, $11}' | sort -k2rn | head -1)
  9. p=$(echo "$a"|awk '{print $1}')
  10. b=$(echo "$a"|awk '{print $3}')
  11. b=$(basename "$b")
  12. echo -ne "\n!> killo \e[1;37m$b\e[m di prepotenza? [\e[1;31mk\e[m] to kill..."
  13. read -sn1
  14. if [[ "$REPLY" == 'k' ]]
  15.     then
  16.         kill -9 "$p"
  17.         echo -e "\n!> KILLED!"
  18.     else
  19.         echo -e "\n!> ...abort"
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment