mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-13 00:58:34 +00:00
add missing configuration copy job
This commit is contained in:
@@ -86,9 +86,40 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 1: Update configuration files
|
# Step 1: Create module configuration files
|
||||||
echo ""
|
echo ""
|
||||||
echo "🔧 Step 1: Updating configuration files..."
|
echo "🔧 Step 1: Creating module configuration files..."
|
||||||
|
|
||||||
|
# Create .conf files from .dist.conf templates for all modules
|
||||||
|
CONFIG_DIR="/azerothcore/config"
|
||||||
|
created_count=0
|
||||||
|
|
||||||
|
for file in "$CONFIG_DIR"/*.dist; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
conffile=$(echo "$file" | sed 's/.dist$//')
|
||||||
|
filename=$(basename "$conffile")
|
||||||
|
|
||||||
|
# Skip core config files (already handled)
|
||||||
|
case "$filename" in
|
||||||
|
authserver.conf|worldserver.conf|dbimport.conf)
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Create .conf file if it doesn't exist
|
||||||
|
if [ ! -f "$conffile" ]; then
|
||||||
|
echo " 📝 Creating $filename from $(basename "$file")"
|
||||||
|
cp "$file" "$conffile"
|
||||||
|
created_count=$((created_count + 1))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo " ✅ Created $created_count module configuration files"
|
||||||
|
|
||||||
|
# Step 2: Update configuration files
|
||||||
|
echo ""
|
||||||
|
echo "🔧 Step 2: Updating configuration files..."
|
||||||
|
|
||||||
# Update DB connection lines and any necessary settings directly with sed
|
# Update DB connection lines and any necessary settings directly with sed
|
||||||
sed -i "s|^LoginDatabaseInfo *=.*|LoginDatabaseInfo = \"${MYSQL_HOST};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_AUTH_NAME}\"|" /azerothcore/config/authserver.conf || true
|
sed -i "s|^LoginDatabaseInfo *=.*|LoginDatabaseInfo = \"${MYSQL_HOST};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_AUTH_NAME}\"|" /azerothcore/config/authserver.conf || true
|
||||||
@@ -102,9 +133,9 @@ else
|
|||||||
|
|
||||||
echo "✅ Configuration files updated"
|
echo "✅ Configuration files updated"
|
||||||
|
|
||||||
# Step 2: Update realmlist table
|
# Step 3: Update realmlist table
|
||||||
echo ""
|
echo ""
|
||||||
echo "🌐 Step 2: Updating realmlist table..."
|
echo "🌐 Step 3: Updating realmlist table..."
|
||||||
mysql -h "${MYSQL_HOST}" -u"${MYSQL_USER}" -p"${MYSQL_ROOT_PASSWORD}" --skip-ssl-verify "${DB_AUTH_NAME}" -e "
|
mysql -h "${MYSQL_HOST}" -u"${MYSQL_USER}" -p"${MYSQL_ROOT_PASSWORD}" --skip-ssl-verify "${DB_AUTH_NAME}" -e "
|
||||||
UPDATE realmlist SET address='${SERVER_ADDRESS}', port=${REALM_PORT} WHERE id=1;
|
UPDATE realmlist SET address='${SERVER_ADDRESS}', port=${REALM_PORT} WHERE id=1;
|
||||||
" || echo "⚠️ Could not update realmlist table"
|
" || echo "⚠️ Could not update realmlist table"
|
||||||
@@ -112,7 +143,7 @@ else
|
|||||||
echo "✅ Realmlist updated"
|
echo "✅ Realmlist updated"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "ℹ️ Step 3: (Optional) Restart services to apply changes — handled externally"
|
echo "ℹ️ Step 4: (Optional) Restart services to apply changes — handled externally"
|
||||||
|
|
||||||
# Create completion marker
|
# Create completion marker
|
||||||
echo "$(date)" > /install-markers/post-install-completed
|
echo "$(date)" > /install-markers/post-install-completed
|
||||||
|
|||||||
44
scripts/copy-module-configs.sh
Executable file
44
scripts/copy-module-configs.sh
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copy module .dist.conf files to .conf files for proper configuration loading
|
||||||
|
# This ensures all module configurations are available and can be customized
|
||||||
|
|
||||||
|
CONFIG_DIR="${STORAGE_PATH:-/nfs/azerothcore}/config"
|
||||||
|
|
||||||
|
echo "Creating module .conf files from .dist.conf templates..."
|
||||||
|
|
||||||
|
cd "$CONFIG_DIR" || {
|
||||||
|
echo "Error: Cannot access config directory: $CONFIG_DIR"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Counter for created files
|
||||||
|
created_count=0
|
||||||
|
|
||||||
|
# Process all .dist files except authserver, worldserver, dbimport (already handled)
|
||||||
|
for file in *.dist; do
|
||||||
|
conffile=$(echo "$file" | sed 's/.dist$//')
|
||||||
|
|
||||||
|
# Skip if it's a core config file (already handled)
|
||||||
|
case "$conffile" in
|
||||||
|
authserver.conf|worldserver.conf|dbimport.conf)
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Create .conf file if it doesn't exist
|
||||||
|
if [ ! -f "$conffile" ]; then
|
||||||
|
echo "Creating $conffile from $file"
|
||||||
|
cp "$file" "$conffile"
|
||||||
|
created_count=$((created_count + 1))
|
||||||
|
else
|
||||||
|
echo "Skipping $conffile (already exists)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Created $created_count module configuration files"
|
||||||
|
echo "Module configuration files are now ready for customization"
|
||||||
|
|
||||||
|
# List all .conf files for verification
|
||||||
|
echo ""
|
||||||
|
echo "Available configuration files:"
|
||||||
|
ls -1 *.conf | sort
|
||||||
Reference in New Issue
Block a user