jkxr/Projects/Android/jni/OpenJK/scripts/docker/healthcheck.sh
Simon 4597b03873 Initial Commit
Opens in Android Studio but haven't even tried to build it yet (it won't.. I know that much!)
2022-09-18 16:37:21 +01:00

26 lines
466 B
Bash

#!/bin/bash
#
# OpenJK server health check script.
#
# Set variables
OJK_DIR="/opt/openjk"
RET=0
# Load functions
. "$OJK_DIR/functions.sh"
# Check server status
INFO=`getinfo`
if [ -z "$INFO" ]; then
# Server didn't respond
RET=1
else
# Server is running
MAPNAME=`parseinfo "$INFO" mapname`
CUR_CLIENTS=`parseinfo "$INFO" clients`
MAX_CLIENTS=`parseinfo "$INFO" sv_maxclients`
echo "Connected players: $CUR_CLIENTS/$MAX_CLIENTS on $MAPNAME"
fi
exit $RET