Created
May 5, 2015 18:54
-
-
Save cameronpickham/1f301ac7a6acd76ad586 to your computer and use it in GitHub Desktop.
killghost
This file contains 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 | |
# Must pass in name of app to kill | |
if [ -z $1 ] ; then exit 0 ; fi | |
# Get PID | |
pid=$(ps aux | grep "bin/$1" | grep -v grep | awk '{print $2}') | |
# Make sure it found one | |
if [ -z $pid ] ; then exit 0 ; fi | |
# Kill | |
sudo kill -15 $pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment