Created
May 2, 2014 07:58
-
-
Save jpibarra1130/fa021d85bf43453465b7 to your computer and use it in GitHub Desktop.
A simple script to kill a running instance of tomcat
This file contains hidden or 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/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