Update docker/mjolnir/start.sh
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
colin 2024-02-05 00:44:39 +00:00
parent 06b493faf1
commit 9b3225dc22
1 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,8 @@
#!/bin/bash
# Update the DEFAULT_CONFIG_PATH to match the new download location
CONFIG_PATH="/etc/mjolnir/config.yml"
DEFAULT_CONFIG_PATH="/etc/mjolnir/default.yml"
DEFAULT_CONFIG_PATH="/etc/mjolnir-defaults/default.yml"
HOME_SERVER_URL="${HOME_SERVER_URL:-https://matrix.org}"
RAW_HOME_SERVER_URL="${RAW_HOME_SERVER_URL:-https://matrix.org}"
ACCESS_TOKEN="${ACCESS_TOKEN:-YOUR_TOKEN_HERE}"
@ -12,7 +13,7 @@ SENTRY_DSN="${SENTRY_DSN:-}"
SENTRY_TRACES_SAMPLE_RATE="${SENTRY_TRACES_SAMPLE_RATE:-0.5}"
WEB_LISTEN_ADDRESS="${WEB_LISTEN_ADDRESS:-0.0.0.0}"
# Ensure default config file exists before attempting to copy
# Check if the default config file exists
if [ ! -f "$DEFAULT_CONFIG_PATH" ]; then
echo "Default config $DEFAULT_CONFIG_PATH not found. Exiting."
exit 1
@ -20,9 +21,11 @@ fi
# Check if the target config file exists, if not, create and configure it
if [ ! -f "$CONFIG_PATH" ]; then
# Ensure the /etc/mjolnir directory exists
mkdir -p /etc/mjolnir
cp $DEFAULT_CONFIG_PATH $CONFIG_PATH
# Ensure config file exists after copy
# Check if copy was successful
if [ ! -f "$CONFIG_PATH" ]; then
echo "Failed to create config file from default. Exiting."
exit 1