Last active
December 21, 2015 18:56
-
-
Save reimai/b8c5b7086cb9c7e64b17 to your computer and use it in GitHub Desktop.
kills whoever is listening on 5005, maven debug sometimes fails to free the damn port
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 | |
#automated killing of maven debug plugin | |
#or anyone else if the port was specified | |
port=${1:-5005} | |
pid=`lsof -t -i :$port | tr -s ' ' | cut -d ' ' -f 2` | |
if [[ -z $pid ]]; then | |
echo "no one to kill 8'(" | |
else | |
echo "killing process listening on port $port \n`ps hp $pid`" | |
kill -9 $pid | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment