entrypoint.sh 999 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. set -o errexit
  3. # Require MINECRAFT_VERSION environment variable to be set (no default assumed)
  4. if [ -z "$MINECRAFT_VERSION" ]; then
  5. echo "Expecting environment variable MINECRAFT_VERSION to be set to non-empty string. Exiting."
  6. exit 1
  7. fi
  8. # Download Minecraft client .jar (Contains textures used by Minecraft Overviewer)
  9. wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MINECRAFT_VERSION}/${MINECRAFT_VERSION}.jar -P /home/minecraft/.minecraft/versions/${MINECRAFT_VERSION}/
  10. # Run the world renders (One pass to make map, one to generate points of interests)
  11. if [ "$POI_ONLY" != "y" ]; then
  12. overviewer.py --config /home/minecraft/config.py $OVERVIEWER_PARAMS
  13. # Add Google Maps API key if the GOOGLE_MAPS_API_KEY environment variable is set
  14. if [ "$GOOGLE_MAPS_API_KEY" ]; then
  15. sed -i "s|https://maps.google.com/maps/api/js|&?key=${GOOGLE_MAPS_API_KEY}|g" /home/minecraft/render/index.html
  16. fi
  17. fi
  18. overviewer.py --config /home/minecraft/config.py --genpoi