mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-29 23:42:38 +00:00
4597b03873
Opens in Android Studio but haven't even tried to build it yet (it won't.. I know that much!)
26 lines
466 B
Bash
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
|