fix drone
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details

dev
Override-6 2 years ago
parent 45810fc368
commit 89a684f692

@ -11,15 +11,15 @@ find_pid() {
ps -aux | tr -s " " | grep -E "\bjava -jar .*$1\b" | cut -d " " -f2
}
SERVER_PROD_PID=$(prod_pid $PROD_SERVER_JAR_NAME)
EMITTER_PROD_PID=$(prod_pid $PROD_EMITTER_JAR_NAME)
SERVER_PROD_PID=$(find_pid $PROD_SERVER_JAR_NAME)
EMITTER_PROD_PID=$(find_pid $PROD_EMITTER_JAR_NAME)
try_shutdown() {
if [ "$1" ]; then
#will cause the old server to gracefully shutdown
echo "shutting down old $2 version ..."
kill "$PROD_PID"
while [ ! "$(prod_pid $2)" ]; do sleep 1; done #sleep until process ends
while [ ! "$(find_pid $2)" ]; do sleep 1; done #sleep until process ends
echo "$2 shut down"
fi
}
@ -39,5 +39,6 @@ if ! screen -ls | grep -q -E "\b[0-9]+\.$SCREEN\b"; then
screen -S "$SCREEN" -d -m
fi
chmod 755 /run/screen
screen -d -r "$SCREEN" -X stuff $"$DIR/start.sh\n"
echo "server is started into $SCREEN screen."