You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Backend/drone/deploy.sh

20 lines
481 B

SERVER_JAR_NAME="server-all.jar"
OLD_PID=$(ps -aux | grep "-jar $SERVER_JAR_NAME" | tr -s " " | cut -d " " -f2)
#if $OLD_PID is not empty but isn't a number, something went wrong
if [ "$OLD_PID" ] && ! grep -E -q "^[0-9]+$"; then
echo "error, unable to retrieve old server pid: $OLD_PID" >&2
exit 2
fi
if [ "$OLD_PID" ]; then
#will cause the old server to gracefully shutdown
echo "shutting down old server version ..."
kill SIGQUIT "$OLD_PID"
wait "$OLD_PID"
fi