From 72d3ac2080d503015418885da6f4be97d18b1121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Tue, 24 Jan 2023 16:17:31 -0700 Subject: [PATCH] testing Some minor improvements. --- lib/general | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/general b/lib/general index 004f841..3917932 100644 --- a/lib/general +++ b/lib/general @@ -621,7 +621,8 @@ wp_conf_retrieve() { # Example: Delete site because its required to drop users. if [[ $2 != "false" && $wp_dbhost_host != "localhost" && -z $wp_dbhost_socket && $(is_url $wp_dbhost) =~ ^(http|https|true|http\+ip|https\+ip|ip)$ ]]; then # Don't needed if already exist a login-file with master-admin privileges! - if [[ $(check_mysql_connection $wp_dbhost_host $wp_dbhost_port any -login-file -master-admin) != "true" ]]; then + # -external-db have priority, mainly to rewrite or update old/wrong credentials. + if [[ -n $external_db || $(check_mysql_connection $wp_dbhost_host $wp_dbhost_port any -login-file -master-admin) != "true" ]]; then if [[ -z $external_db && -n $(conf_read external-dbh) && -n $(conf_read external-dbx) && $wp_dbhost == "$(conf_read external-dbh):$(conf_read external-dbx)" ]]; then check_external_db_saved elif [[ -z $external_db && -n $(conf_read external-dbh) ]]; then @@ -637,6 +638,7 @@ wp_conf_retrieve() { unset extdb_host unset extdb_url unset extdb_port + echo "${red}${dim}[ERROR] External DB credentials cannot be used! (host mismatch)${end}" fi fi if [[ -z $external_db ]]; then