Commit 4748d0ed authored by 赵啸非's avatar 赵啸非

添加服务检测拉起脚本

parent 23322439
......@@ -181,7 +181,7 @@
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.filepath>/home/mortals/app/data</profiles.filepath>
<profiles.filepath>/mortals/app/data</profiles.filepath>
<package.environment>yibin</package.environment>
<skipDeploy>false</skipDeploy>
</properties>
......
#!/bin/bash
PORT="@profiles.server.port@"
PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
SHELL_NAME=$0
SHELL_LOG="${SHELL_NAME}.log"
LOG_DATE='date "+%Y-%m-%d"'
LOG_TIME='date "+%H-%M-%S"'
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H-%M-%S")
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
}
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ $jcpid ]; then
writelog "The $PROJECT_NAME start finished, PID is $jcpid"
exit $SUCCESS
else
writelog "start service..."
systemctl stop ${PROJECT_NAME} && systemctl start ${PROJECT_NAME}
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment