Last active
August 5, 2016 14:04
-
-
Save shospodarets/b839369cabb16a6d49a98cfba58fcbe8 to your computer and use it in GitHub Desktop.
Script to kill all the processes which established connection to the port.Usage: './checkport.sh 35729' (clear the livereload 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
#!/usr/bin/env bash | |
function terminate { | |
echo ':'$1 | |
lsof -P | grep ':'$1 | awk '{print $2}' | xargs kill -9 | |
} | |
terminate $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment