diff --git a/README.md b/README.md index 372c46a4..cd598dc4 100644 --- a/README.md +++ b/README.md @@ -766,6 +766,10 @@ downloaded, scaled, and converted from any other image format: docker run -d -e ICON=http://..../some/image.png ... +The server icon which has been set doesn't get overridden by default. It can be changed and overridden by setting `OVERRIDE_ICON` to `TRUE`. + + docker run -d -e ICON=http://..../some/other/image.png -e OVERRIDE_ICON=TRUE... + ### Rcon To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables. diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 545dfc10..812a9bb0 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -14,17 +14,19 @@ if [ -n "$WHITELIST" ]; then echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt fi -if [ -n "$ICON" -a ! -e server-icon.png ]; then - log "Using server icon from $ICON..." - # Not sure what it is yet...call it "img" - curl -sSL -o /tmp/icon.img $ICON - specs=$(identify /tmp/icon.img | awk '{print $2,$3}') - if [ "$specs" = "PNG 64x64" ]; then - mv /tmp/icon.img /data/server-icon.png - else - log "Converting image to 64x64 PNG..." - convert /tmp/icon.img -resize 64x64! /data/server-icon.png - fi +if [ -n "$ICON" ]; then + if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then + log "Using server icon from $ICON..." + # Not sure what it is yet...call it "img" + curl -sSL -o /tmp/icon.img $ICON + specs=$(identify /tmp/icon.img | awk '{print $2,$3}') + if [ "$specs" = "PNG 64x64" ]; then + mv /tmp/icon.img /data/server-icon.png + else + log "Converting image to 64x64 PNG..." + convert /tmp/icon.img -resize 64x64! /data/server-icon.png + fi + fi fi if ! isTrue ${SKIP_LOG4J_CONFIG}; then