This commit is contained in:
2026-09-13 12:45:55 +04:00
parent 0a277174bc
commit 2b6e2f12fb
4 changed files with 9 additions and 0 deletions
+6
View File
@@ -15,6 +15,7 @@ external_address="${EXTERNAL_ADDRESS:-127.0.0.1}"
realm_name="${REALM_NAME:-Sylvania Solo}"
realm_address="${REALM_ADDRESS:-127.0.0.1}"
realm_port="${REALM_PORT:-8086}"
dbc_locale="${DBC_LOCALE:-8}"
if [[ ! "${realm_name}" =~ ^[[:alnum:]А-Яа-яЁё._[:space:]-]{1,32}$ ]]; then
echo "REALM_NAME contains unsupported characters or is longer than 32 characters" >&2
@@ -28,6 +29,10 @@ if [[ ! "${realm_port}" =~ ^[0-9]+$ ]] || (( realm_port < 1 || realm_port > 6553
echo "REALM_PORT must be an integer between 1 and 65535" >&2
exit 1
fi
if [[ ! "${dbc_locale}" =~ ^[0-9]+$ ]] || (( dbc_locale > 11 || dbc_locale == 9 )); then
echo "DBC_LOCALE must be a valid locale index (ruRU is 8)" >&2
exit 1
fi
config_dir=/opt/sylvania/etc
template="${config_dir}/${server}.conf.dist"
@@ -63,6 +68,7 @@ if [[ "${server}" == worldserver ]]; then
-e "s#^(HotfixDatabaseInfo[[:space:]]*=).*#\\1 \"${db_host};${db_port};${db_user};${db_password};hotfixes\"#" \
-e "s#^(ShopDatabaseInfo[[:space:]]*=).*#\\1 \"${db_host};${db_port};${db_user};${db_password};shop\"#" \
-e 's#^DataDir[[:space:]]*=.*#DataDir = "/opt/sylvania/data"#' \
-e "s#^DBC.Locale[[:space:]]*=.*#DBC.Locale = ${dbc_locale}#" \
-e 's#^LogsDir[[:space:]]*=.*#LogsDir = "/opt/sylvania/logs"#' \
"${config}"
else