mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 06:14:14 +00:00
Only write EULA when it's set to TRUE
(#387)
* Only write EULA when it's set to `TRUE` - This prevents a false value to be written while not being able to correct it afterwards using the environment variable. * Convert EULA value to upper case to allow lower case `true` as value
This commit is contained in:
parent
62a4541df5
commit
34d4ae0b59
1 changed files with 10 additions and 8 deletions
|
@ -6,14 +6,8 @@ shopt -s nullglob
|
|||
export HOME=/data
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if [ "$EULA" != "" ]; then
|
||||
echo "# Generated via Docker on $(date)" > eula.txt
|
||||
echo "eula=$EULA" >> eula.txt
|
||||
if [ $? != 0 ]; then
|
||||
echo "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
EULA="${EULA^^}"
|
||||
if [ "$EULA" != "TRUE" ]; then
|
||||
echo ""
|
||||
echo "Please accept the Minecraft EULA at"
|
||||
echo " https://account.mojang.com/documents/minecraft_eula"
|
||||
|
@ -22,8 +16,16 @@ if [ ! -e /data/eula.txt ]; then
|
|||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Generated via Docker on $(date)" > eula.txt
|
||||
echo "eula=$EULA" >> eula.txt
|
||||
if [ $? != 0 ]; then
|
||||
echo "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if ! touch /data/.verify_access; then
|
||||
|
|
Loading…
Reference in a new issue