Skip to content

Instantly share code, notes, and snippets.

@arahansa
Last active August 19, 2016 01:31
Show Gist options
  • Save arahansa/9e8a41036781b85d709776b1f42d6f18 to your computer and use it in GitHub Desktop.
Save arahansa/9e8a41036781b85d709776b1f42d6f18 to your computer and use it in GitHub Desktop.
#! /bin/bash
# check 7100 port
pidNumber=$(lsof -i :7100 | grep java | awk '{print $2}' )
if [ ! -z "$pidNumber" ];then
echo "already ** is operating. please command ./kill_7100Port_****.sh"
exit
fi
# check executeFile
if [ -z "$1" ];then
executeFile=$(ls -Art | grep .jar | tail -n 1)
else
executeFile=$1
fi
echo "*** is executed!"
echo "Mode : production , fileName : " $executeFile
#-Xms1G -Xmx1G
nohup java -XX:+UseParallelOldGC -d64 -server -verbose:gc -Xloggc:/usr/share/tomcat8/logs/****/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dfile.encoding=UTF8 -Dspring.profiles.active=prod -jar $executeFile &
#! /bin/bash
pidNumber=$(lsof -i :7100 | grep java | awk '{print $2}' )
if [ ! -z "$pidNumber" ];then
echo "killing this 7100 port pid : " $pidNumber
kill -9 $pidNumber
else
echo "there is no usage in 7100 port "
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment