Skip to content

Instantly share code, notes, and snippets.

@cameronpickham
Created May 5, 2015 18:54
Show Gist options
  • Save cameronpickham/1f301ac7a6acd76ad586 to your computer and use it in GitHub Desktop.
Save cameronpickham/1f301ac7a6acd76ad586 to your computer and use it in GitHub Desktop.
killghost
#!/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