mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Corrected autopause's resume to work with alpine images (#1464)
This commit is contained in:
parent
4af80debe2
commit
97fe6b1f14
@ -57,13 +57,7 @@ WORKDIR /data
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0 \
|
||||
ENABLE_AUTOSTOP=false AUTOSTOP_TIMEOUT_EST=3600 AUTOSTOP_TIMEOUT_INIT=1800 AUTOSTOP_PERIOD=10
|
||||
ENV TYPE=VANILLA VERSION=LATEST EULA=""
|
||||
|
||||
COPY --chmod=755 scripts/start* /
|
||||
COPY --chmod=755 bin/ /usr/local/bin/
|
||||
|
@ -3,13 +3,13 @@
|
||||
[unpauseMCServer-server]
|
||||
sequence = 25565
|
||||
seq_timeout = 1
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
command = /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-rcon]
|
||||
sequence = 25575
|
||||
seq_timeout = 1
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
command = /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-bedrock]
|
||||
sequence = 19132:udp
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
command = /autopause/resume.sh
|
||||
|
@ -4,7 +4,19 @@
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
: "${SERVER_PORT:=25565}"
|
||||
: "${ENABLE_AUTOPAUSE:=false}"
|
||||
: "${AUTOPAUSE_TIMEOUT_EST:=3600}"
|
||||
: "${AUTOPAUSE_TIMEOUT_KN:=120}"
|
||||
: "${AUTOPAUSE_TIMEOUT_INIT:=600}"
|
||||
: "${AUTOPAUSE_PERIOD:=10}"
|
||||
: "${AUTOPAUSE_KNOCK_INTERFACE:=eth0}"
|
||||
export SERVER_PORT
|
||||
export ENABLE_AUTOPAUSE
|
||||
export AUTOPAUSE_TIMEOUT_EST
|
||||
export AUTOPAUSE_TIMEOUT_KN
|
||||
export AUTOPAUSE_TIMEOUT_INIT
|
||||
export AUTOPAUSE_PERIOD
|
||||
export AUTOPAUSE_KNOCK_INTERFACE
|
||||
|
||||
log "Autopause functionality enabled"
|
||||
|
||||
|
@ -4,7 +4,15 @@
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
: "${SERVER_PORT:=25565}"
|
||||
: "${ENABLE_AUTOSTOP:=false}"
|
||||
: "${AUTOSTOP_TIMEOUT_EST:=3600}"
|
||||
: "${AUTOSTOP_TIMEOUT_INIT:=1800}"
|
||||
: "${AUTOSTOP_PERIOD:=10}"
|
||||
export SERVER_PORT
|
||||
export ENABLE_AUTOSTOP
|
||||
export AUTOSTOP_TIMEOUT_EST
|
||||
export AUTOSTOP_TIMEOUT_INIT
|
||||
export AUTOSTOP_PERIOD
|
||||
|
||||
log "Autostop functionality enabled"
|
||||
|
||||
|
@ -7,13 +7,18 @@ IFS=$'\n\t'
|
||||
|
||||
: "${EULA:=}"
|
||||
: "${PROXY:=}"
|
||||
: "${RCON_PASSWORD_FILE:=}"
|
||||
: "${ENABLE_AUTOPAUSE:=false}"
|
||||
: "${ENABLE_AUTOSTOP:=false}"
|
||||
: "${RCON_CMDS_STARTUP:=}"
|
||||
: "${RCON_CMDS_ON_CONNECT:=}"
|
||||
: "${RCON_CMDS_ON_DISCONNECT:=}"
|
||||
: "${RCON_CMDS_FIRST_CONNECT:=}"
|
||||
: "${RCON_CMDS_LAST_DISCONNECT:=}"
|
||||
: "${RCON_CMDS_PERIOD:=10}"
|
||||
: "${RCON_PASSWORD_FILE:=}"
|
||||
: "${RCON_PASSWORD:=minecraft}"
|
||||
: "${RCON_PORT:=25575}"
|
||||
export RCON_PASSWORD RCON_PORT
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
|
@ -97,6 +97,7 @@ if [[ ${GUI,,} = false ]]; then
|
||||
EXTRA_ARGS+=" nogui"
|
||||
fi
|
||||
|
||||
: "${MEMORY:=1G}"
|
||||
: "${INIT_MEMORY:=${MEMORY}}"
|
||||
: "${MAX_MEMORY:=${MEMORY}}"
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
: "${SERVER_PROPERTIES:=/data/server.properties}"
|
||||
: "${ENABLE_RCON:=true}"
|
||||
|
||||
# FUNCTIONS
|
||||
function setServerPropValue {
|
||||
|
11
tests/setuponlytests/defaults/docker-compose.yml
Normal file
11
tests/setuponlytests/defaults/docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
restart: "no"
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
volumes:
|
||||
- ./data:/data
|
3
tests/setuponlytests/defaults/verify.sh
Normal file
3
tests/setuponlytests/defaults/verify.sh
Normal file
@ -0,0 +1,3 @@
|
||||
mc-image-helper assert propertyEquals --file=server.properties --property=rcon.password --expect=minecraft
|
||||
mc-image-helper assert propertyEquals --file=server.properties --property=rcon.port --expect=25575
|
||||
mc-image-helper assert propertyEquals --file=server.properties --property=enable-rcon --expect=true
|
Loading…
Reference in New Issue
Block a user