update jshERP-boot/src/main/bin/run-manage.sh.

This commit is contained in:
季圣华
2021-05-11 10:53:54 +08:00
committed by Gitee
parent 9159f23362
commit 3bd9510f26

View File

@@ -1,30 +1,21 @@
SERVER_NAME=jshERP SERVER_NAME=jshERP
readonly APP_HOME=${FILE_PATH:-$(dirname $(cd `dirname $0`; pwd))} readonly APP_HOME=${FILE_PATH:-$(dirname $(cd `dirname $0`; pwd))}
#readonly JAVA_HOME="" #readonly JAVA_HOME=""
readonly CONFIG_HOME="$APP_HOME/config/" readonly CONFIG_HOME="$APP_HOME/config/"
readonly LIB_HOME="$APP_HOME/lib" readonly LIB_HOME="$APP_HOME/lib"
readonly LOGS_HOME="$APP_HOME/logs" readonly LOGS_HOME="$APP_HOME/logs"
readonly PID_FILE="$LOGS_HOME/application.pid" readonly PID_FILE="$LOGS_HOME/application.pid"
readonly APP_MAIN_CLASS="jshERP3.0.jar" readonly APP_MAIN_CLASS="jshERP3.0.jar"
readonly LOG_CONFIG="$CONFIG_HOME/logback-spring.xml" readonly LOG_CONFIG="$CONFIG_HOME/logback-spring.xml"
readonly JAVA_RUN="-Dlogs.home=$LOGS_HOME -Dlogging.config=$LOG_CONFIG -Dspring.config.location=file:$CONFIG_HOME -Dspring.pid.file=$PID_FILE -Dspring.pid.fail-on-write-error=true" readonly JAVA_RUN="-Dlogs.home=$LOGS_HOME -Dlogging.config=$LOG_CONFIG -Dspring.config.location=file:$CONFIG_HOME -Dspring.pid.file=$PID_FILE -Dspring.pid.fail-on-write-error=true"
readonly JAVA_OPTS="-server -Xms128m -Xmx320m -XX:PermSize=128M -XX:MaxPermSize=256M $JAVA_RUN" readonly JAVA_OPTS="-server -Xms128m -Xmx320m -XX:PermSize=128M -XX:MaxPermSize=256M $JAVA_RUN"
readonly JAVA="java" readonly JAVA="java"
PID=0 PID=0
if [ ! -x "$LOGS_HOME" ] if [ ! -x "$LOGS_HOME" ]
then then
mkdir $LOGS_HOME mkdir $LOGS_HOME
fi fi
chmod +x -R "$JAVA_HOME/bin/" chmod +x -R "$JAVA_HOME/bin/"
functions="/etc/functions.sh" functions="/etc/functions.sh"
if test -f $functions ; then if test -f $functions ; then
. $functions . $functions
@@ -42,7 +33,6 @@ else
echo "WARNING! $@" echo "WARNING! $@"
} }
fi fi
function checkpid() { function checkpid() {
PID=$(ps -ef | grep $APP_MAIN_CLASS | grep -v 'grep' | awk '{print int($2)}') PID=$(ps -ef | grep $APP_MAIN_CLASS | grep -v 'grep' | awk '{print int($2)}')
if [[ -n "$PID" ]] if [[ -n "$PID" ]]
@@ -52,7 +42,6 @@ function checkpid() {
return 1 return 1
fi fi
} }
function start() { function start() {
checkpid checkpid
if [[ $? -eq 0 ]] if [[ $? -eq 0 ]]
@@ -73,7 +62,6 @@ function start() {
fi fi
fi fi
} }
function stop() { function stop() {
checkpid checkpid
if [[ $? -eq 0 ]]; if [[ $? -eq 0 ]];
@@ -91,7 +79,6 @@ function stop() {
warning "[$APP_MAIN_CLASS]: is not running ..." warning "[$APP_MAIN_CLASS]: is not running ..."
fi fi
} }
function status() { function status() {
checkpid checkpid
if [[ $? -eq 0 ]] if [[ $? -eq 0 ]]
@@ -103,7 +90,6 @@ function status() {
return 1 return 1
fi fi
} }
function info() { function info() {
echo "System Information:" echo "System Information:"
echo echo
@@ -121,7 +107,6 @@ function info() {
echo echo
echo "****************************" echo "****************************"
} }
case "$1" in case "$1" in
'start') 'start')
start start
@@ -143,4 +128,4 @@ case "$1" in
echo "Usage: $0 {help|start|stop|restart|status|info}" echo "Usage: $0 {help|start|stop|restart|status|info}"
;; ;;
esac esac
exit 0 exit 0