From e0b90ef9d65c7e7a3756920f0f8f9bfa50204c7b Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sat, 11 Feb 2023 19:43:58 +0100 Subject: [PATCH] v-install-wordpress: Check if MariaDB allows long database name --- bin/v-install-wordpress | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/v-install-wordpress b/bin/v-install-wordpress index 0e24f847..4bf82c5f 100644 --- a/bin/v-install-wordpress +++ b/bin/v-install-wordpress @@ -26,6 +26,7 @@ USER=$user # Includes source /usr/local/vesta/func/main.sh source /usr/local/vesta/func/db.sh +source /usr/local/vesta/conf/vesta.conf if [ -z "$user" ]; then check_result $E_NOTEXIST "domain $domain doesn't exist" @@ -49,7 +50,11 @@ is_object_unsuspended 'user' 'USER' "$user" source /usr/local/vesta/func/handle_parameters.sh if [ -z "$database" ]; then - database=$(echo "$domain" | sed 's#\.#_#g') + if [ ! -z "$MAX_DBUSER_LEN" ] && [ "$MAX_DBUSER_LEN" -ge 80 ]; then + database=$(echo "$domain" | sed 's#\.#_#g') + else + database="wp" + fi fi if [ -z "$email" ]; then