From 34d4ae0b59cdc50660e4e980b565d3f8d2ad2d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Richter?= <2268851+x3rAx@users.noreply.github.com> Date: Mon, 16 Sep 2019 00:15:33 +0200 Subject: [PATCH] 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 --- start-configuration | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/start-configuration b/start-configuration index 8581d7ec..58ef75fd 100644 --- a/start-configuration +++ b/start-configuration @@ -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