diff --git a/Dockerfile b/Dockerfile
index 8789272..45a9aa9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,7 @@ ENV RENDER_POI "true"
ENV RENDER_SIGNS_FILTER "-- RENDER --"
ENV RENDER_SIGNS_HIDE_FILTER "false"
ENV RENDER_SIGNS_JOINER "
"
+ENV REFRESH_DURATION 0
# ---------------------------- #
# INSTALL & CONFIGURE DEFAULTS #
diff --git a/README.md b/README.md
index f263838..bec88a4 100644
--- a/README.md
+++ b/README.md
@@ -57,3 +57,5 @@ _Note:_ The `latest` Docker tag is rebuilt daily. If there are changes to the [u
- `RENDER_SIGNS_JOINER`
Default Value: `
`. Set to the string that should be used to join the lines on the sign while rendering. Value of `"
"` will make each in-game line it's own line on the render. A value of `" "` will make all the in-game lines a single line on the render.
+- `REFRESH_DURATION`
+ Default Value: `0`. Set to a number to regenerate the map every `REFRESH_DURATION` seconds. Disabled if set to `0`.
\ No newline at end of file
diff --git a/entrypoint.sh b/entrypoint.sh
index 1ac800d..8f6b36e 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,6 +1,22 @@
#!/bin/bash
set -o errexit
+render_map() {
+ # Render the Map
+ if [ "$RENDER_MAP" == "true" ]; then
+ # (We disable to support passing multiple arguments)
+ # shellcheck disable=SC2086
+ overviewer.py --config "$CONFIG_LOCATION" $ADDITIONAL_ARGS
+ fi
+
+ # Render the POI
+ if [ "$RENDER_POI" == "true" ]; then
+ # (We disable to support passing multiple arguments)
+ # shellcheck disable=SC2086
+ overviewer.py --config "$CONFIG_LOCATION" --genpoi $ADDITIONAL_ARGS_POI
+ fi
+}
+
# Require MINECRAFT_VERSION environment variable to be set (no default assumed)
if [ -z "$MINECRAFT_VERSION" ]; then
echo "Expecting environment variable MINECRAFT_VERSION to be set to non-empty string. Exiting."
@@ -30,16 +46,12 @@ else
echo "Download complete."
fi
-# Render the Map
-if [ "$RENDER_MAP" == "true" ]; then
- # (We disable to support passing multiple arguments)
- # shellcheck disable=SC2086
- overviewer.py --config "$CONFIG_LOCATION" $ADDITIONAL_ARGS
-fi
-
-# Render the POI
-if [ "$RENDER_POI" == "true" ]; then
-# (We disable to support passing multiple arguments)
- # shellcheck disable=SC2086
- overviewer.py --config "$CONFIG_LOCATION" --genpoi $ADDITIONAL_ARGS_POI
-fi
+# Render the map, either once if REFRESH_DURATION is 0, or every REFRESH_DURATION seconds
+if [ $REFRESH_DURATION -gt 0 ]; then
+ while true; do
+ render_map
+ sleep $REFRESH_DURATION
+ done
+else
+ render_map
+fi
\ No newline at end of file