Skip to content

Instantly share code, notes, and snippets.

@jpibarra1130
Created May 2, 2014 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpibarra1130/fa021d85bf43453465b7 to your computer and use it in GitHub Desktop.
Save jpibarra1130/fa021d85bf43453465b7 to your computer and use it in GitHub Desktop.
A simple script to kill a running instance of tomcat
#!/bin/sh
PID="$(pgrep -f tomcat-7.0.53-9090)"
echo "Tomcat PID: $PID"
if [ -z "$PID" ]
then
echo 'Tomcat is not running.'
else
echo 'Tomcat is running. Kill.'
kill -9 "$PID"
echo 'Tomcat killed.'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment