File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # shellcheck source=../scripts/start-utils
4
+ . " ${SCRIPTS:-/ } start-utils"
3
5
current_uptime () {
4
6
awk ' {print $1}' /proc/uptime | cut -d . -f 1
5
7
}
@@ -16,14 +18,20 @@ rcon_client_exists() {
16
18
[[ -n " $( ps -ax -o comm | grep ' rcon-cli' ) " ]]
17
19
}
18
20
21
+ use_proxy () {
22
+ if isTrue " $USES_PROXY_PROTOCOL " ; then
23
+ echo " --use-proxy"
24
+ fi
25
+ }
26
+
19
27
mc_server_listening () {
20
- mc-monitor status --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " --timeout 10s >& /dev/null
28
+ mc-monitor status $( use_proxy ) --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " --timeout 10s >& /dev/null
21
29
}
22
30
23
31
java_clients_connections () {
24
32
local connections
25
- if java_running ; then
26
- if ! connections=$( mc-monitor status --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " --show-player-count) ; then
33
+ if java_running; then
34
+ if ! connections=$( mc-monitor status $( use_proxy ) --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " --show-player-count) ; then
27
35
# consider it a non-zero player count if the ping fails
28
36
# otherwise a laggy server with players connected could get paused
29
37
connections=1
You can’t perform that action at this time.
0 commit comments