Skip to content

Instantly share code, notes, and snippets.

@hyphenPaul
Created July 10, 2013 15:09
Show Gist options
  • Save hyphenPaul/5967097 to your computer and use it in GitHub Desktop.
Save hyphenPaul/5967097 to your computer and use it in GitHub Desktop.
Kills local process listening on port 3000. I use this to kill my detached development server on http://0.0.0.0:3000.
#! /bin/bash
# kills any process listening on port 3000
KILLPID=`lsof -t -i :3000`
if [ -z $KILLPID ]; then
echo "Nothing listening on port 3000"
else
kill -9 $KILLPID
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment