mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-12 13:22:28 +00:00
Merge branch 'master' into multiarch
Renamed to start-deployFTBA # Conflicts: # start-configuration # start-deployCF
This commit is contained in:
commit
8101c8b51c
6 changed files with 21 additions and 21 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
. /start-utils
|
||||
|
||||
sudo /usr/sbin/knockd -c /autopause/knockd-config.cfg -d
|
||||
sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d
|
||||
if [ $? -ne 0 ] ; then
|
||||
while :
|
||||
do
|
||||
|
|
5
start
5
start
|
@ -36,11 +36,6 @@ if [ $(id -u) = 0 ]; then
|
|||
chown -R ${runAsUser}:${runAsGroup} /data
|
||||
fi
|
||||
|
||||
if [[ $(stat -c "%u" /autopause) != $UID ]]; then
|
||||
log "Changing ownership of /autopause to $UID ..."
|
||||
chown -R ${runAsUser}:${runAsGroup} /autopause
|
||||
fi
|
||||
|
||||
if [[ ${SKIP_NSSWITCH_CONF^^} != TRUE ]]; then
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
fi
|
||||
|
|
|
@ -4,18 +4,20 @@
|
|||
|
||||
log "Autopause functionality enabled"
|
||||
|
||||
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
|
||||
|
||||
# update server port to listen to
|
||||
regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
|
||||
linenum=$(grep -nm1 sequence /autopause/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /autopause/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /autopause/knockd-config.cfg
|
||||
linenum=$(grep -nm1 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /tmp/knockd-config.cfg
|
||||
log "Updated server port in knockd config"
|
||||
fi
|
||||
# update rcon port to listen to
|
||||
regseq="^\s*sequence\s*=\s*$RCON_PORT\s*$"
|
||||
linenum=$(grep -nm2 sequence /autopause/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /autopause/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /autopause/knockd-config.cfg
|
||||
linenum=$(grep -nm2 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
|
||||
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
|
||||
sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /tmp/knockd-config.cfg
|
||||
log "Updated rcon port in knockd config"
|
||||
fi
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ export HOME=/data
|
|||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
EULA="${EULA,,}"
|
||||
if [ "$EULA" != "true" ]; then
|
||||
if ! isTrue "$EULA"; then
|
||||
log ""
|
||||
log "Please accept the Minecraft EULA at"
|
||||
log " https://account.mojang.com/documents/minecraft_eula"
|
||||
|
@ -21,12 +20,7 @@ if [ ! -e /data/eula.txt ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Generated via Docker on $(date)" > /data/eula.txt
|
||||
|
||||
if ! echo "eula=$EULA" >> /data/eula.txt; then
|
||||
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||
exit 2
|
||||
fi
|
||||
writeEula
|
||||
fi
|
||||
|
||||
|
||||
|
@ -102,7 +96,7 @@ case "${TYPE^^}" in
|
|||
;;
|
||||
|
||||
FTBA)
|
||||
exec ${SCRIPTS:-/}start-deployFTB "$@"
|
||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||
;;
|
||||
|
||||
CURSEFORGE|FTB)
|
||||
|
|
|
@ -113,3 +113,12 @@ requireVar() {
|
|||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function writeEula() {
|
||||
if ! echo "# Generated via Docker on $(date)
|
||||
eula=${EULA,,}
|
||||
" > /data/eula.txt; then
|
||||
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue