Skip to content

Instantly share code, notes, and snippets.

@daryltucker
Created May 11, 2018 05:12
Show Gist options
  • Save daryltucker/e5625729625d52c0306e53fe37cc2d26 to your computer and use it in GitHub Desktop.
Save daryltucker/e5625729625d52c0306e53fe37cc2d26 to your computer and use it in GitHub Desktop.
Update Minecraft Overviewer Google Maps API Key
#!/bin/bash
# Maybe there is an 'official' way... this works with cron so :"D
G_MAPS_KEY=""
WORLD_PATH="/home/minecraft/minecraft-1.12.2/world/"
WWW_PATH="/home/minecraft/minecraft-1.12.2/www-overviewer/"
OLD_MAP_SRC="api/js?sensor=false"
NEW_MAP_SRC="api/js\?key=${G_MAPS_KEY}\&sensor=false"
overviewer.py ${WORLD_PATH} ${WWW_PATH}
sed -i "s#${OLD_MAP_SRC}#${NEW_MAP_SRC}#g" ${WWW_PATH}index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment