summaryrefslogtreecommitdiff
path: root/apps/docker/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'apps/docker/entrypoint.sh')
-rw-r--r--apps/docker/entrypoint.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/docker/entrypoint.sh b/apps/docker/entrypoint.sh
new file mode 100644
index 0000000000..62504fc0de
--- /dev/null
+++ b/apps/docker/entrypoint.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -euo pipefail
+
+# Copy all default config files to env/dist/etc if they don't already exist
+# -r == recursive
+# -n == no clobber (don't overwrite)
+# -v == be verbose
+cp -rnv /azerothcore/env/ref/etc/* /azerothcore/env/dist/etc
+
+CONF="/azerothcore/env/dist/etc/$ACORE_COMPONENT.conf"
+CONF_DIST="/azerothcore/env/dist/etc/$ACORE_COMPONENT.conf.dist"
+
+# Copy the "dist" file to the "conf" if the conf doesn't already exist
+if [[ -f "$CONF_DIST" ]]; then
+ cp -vn "$CONF_DIST" "$CONF"
+else
+ touch "$CONF"
+fi
+
+echo "Starting $ACORE_COMPONENT..."
+
+exec "$@"