Remove deprecated commands:
wp-admin global
default-dbrole
saved-externaldb
This commit is contained in:
Cristhian Martínez Ochoa 2022-05-28 16:07:41 -06:00
parent c50569c9d5
commit bbea4976dd
3 changed files with 1 additions and 74 deletions

View file

@ -1033,59 +1033,6 @@ database_import() {
}
ext_db_save() {
if [[ $external_db_save == "purge" || -n $purge ]]; then
conf_delete external-dbu -commented
conf_delete external-dbp -commented
conf_delete external-dbh -commented
conf_delete external-dbx -commented
echo "${gre}External DB data successfully removed!${end}"
else
if [[ $external_db_save == "true" ]]; then
read -p "${blu} Host: ${end}" host
read -p "${blu} User: ${end}" user
read -p "${blu} Password: ${end}" pass
if [[ -z $host || -z $user || -z $pass || $user =~ [:]+ || $pass =~ [:]+ ]]; then
echo "${red}[ERROR] Invalid data for External Database!${end}"
exit 1
fi
else
# Prevent errors
if [[ ${#external_db_save} -lt 2 ]]; then
echo "${red}[ERROR] Invalid data for External Database!${end}"
exit 1
fi
local dbdata=${external_db_save:1:-1}
local user=$(echo "${dbdata}" | cut -d',' -f 1 -s)
local pass=$(echo "${dbdata}" | cut -d',' -f 2 -s)
local host=$(echo "${dbdata}" | cut -d',' -f 3 -s)
if [[ $(echo "${external_db_save}" | cut -c-1) != "[" || $(echo "${external_db_save}" | rev | cut -c-1) != "]" || -z $host || -z $user || -z $pass || $user =~ [:]+ || $pass =~ [:]+ ]]; then
echo "${red}[ERROR] Invalid data for External Database!${end}"
exit 1
fi
fi
is_url $host -split
if [[ -z $url_path && $(is_url $host) =~ ^(http|https|ip|true)$ && -n $url_host && -n $url_port ]]; then
conf_write external-dbh $url_host
conf_write external-dbx $url_port
else
echo "${red}[ERROR] Invalid database host/port!${end}"
exit 1
fi
conf_write external-dbu $user
conf_write external-dbp $pass
echo "${gre}External DB data successfully saved!${end}"
fi
}
http_header_custom() {
if ! [[ $custom_headers =~ ^(reload|remove)$ ]]; then
echo "${red}[ERROR] Please, enter a valid option Custom Headers!${end}"

View file

@ -131,14 +131,6 @@ elif [[ -n $wp_admin ]]; then
echo "${gre}WordPress Admin HTTP Authentication for${blu} $domain$subfolder ${gre}is already disabled! ${end}"
nginx_not="true" # Nginx-Reload not-needed.
fi
elif [[ $wp_admin == "on" ]]; then
conf_write wp-admin-auth true
echo "${gre}WordPress Admin HTTP Authentication has been enabled! (global)${end}"
nginx_not="true" # Nginx-Reload not-needed.
elif [[ $wp_admin == "off" ]]; then
conf_write wp-admin-auth false
echo "${gre}WordPress Admin HTTP Authentication has been disabled! (global)${end}"
nginx_not="true" # Nginx-Reload not-needed.
else
echo "${red}[ERROR] Invalid value for wp-admin! ${end}"
exit 1

View file

@ -2,7 +2,7 @@
# Webinoly Server Manager Plugin
# Syntax: webinoly <option> <argument>
# Options: -update, -server-reset, -verify, -dbpass, -tools-port, -login-www-data, -cache-valid, -uninstall, -info, -external-sources-update, -clear-cache, -version, -blockip, -conf-value_, -default-site, -tools-site, -mysql-password, -smtp, -backup, -aws-s3-credentials, -db-import, -send-to-s3, -custom-headers, -skip-cache, -skip-cookie-cache, -query-string-cache, -query-string-never-cache, -email, -external-db-save, -export, -import, -db-role-default, -mysql-public-access
# Options: -update, -server-reset, -verify, -dbpass, -tools-port, -login-www-data, -cache-valid, -uninstall, -info, -external-sources-update, -clear-cache, -version, -blockip, -conf-value_, -default-site, -tools-site, -mysql-password, -smtp, -backup, -aws-s3-credentials, -db-import, -send-to-s3, -custom-headers, -skip-cache, -skip-cookie-cache, -query-string-cache, -query-string-never-cache, -email, -export, -import, -mysql-public-access
# Arguments: -raw, -profile, -list, -bucket, -source, -delete, -run, -restore, -wp, -destination, -date, -s3-european-buckets, info, -file, -add-db-pre, -no-recovery, -recalculate, -dbname, -skip-db, -filename, -overwrite
source /opt/webinoly/lib/webin
@ -270,18 +270,6 @@ elif [[ -n $email ]]; then
nginx_not="true" # Nginx-Reload not-needed.
elif [[ -n $external_db_save ]]; then
ext_db_save
nginx_not="true" # Nginx-Reload not-needed.
elif [[ -n $db_role_default ]]; then
db_role_check $db_role_default
conf_write dbrole $db_role_default
echo "${gre}Default role for Database creation has been set to '${db_role_default}' successfully! ${end}"
nginx_not="true" # Nginx-Reload not-needed.
elif [[ -n $mysql_public_access ]]; then
mysql_public_access
nginx_not="true" # Nginx-Reload not-needed.