Skip to content

Instantly share code, notes, and snippets.

@cpusoft
Last active May 10, 2019 01:43
Show Gist options
  • Save cpusoft/3c87b5c4bf53f3749064b9495fbd3854 to your computer and use it in GitHub Desktop.
Save cpusoft/3c87b5c4bf53f3749064b9495fbd3854 to your computer and use it in GitHub Desktop.
shutdown.sh
pid=`ps -ef|grep '/web/tomcat/'|grep -v grep|awk '{print $2}'`
echo "The current process id is $pid"
if [ "$pid" = "" ]; then
echo "pid is null"
else
kill -9 $pid
echo "shutdown success"
fi
pids=`ps -ef|grep 'manage.py'|grep -v grep|awk '{print $2}'`
echo "The current process id is $pids"
for pid in $pids
do
if [ "$pid" = "" ]; then
echo "pid is null"
else
kill -9 $pid
echo "shutdown success"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment