Critical error during site deletion when using external MySQL host #324
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During site deletion, the hostname for the site's MySQL user was pulled from the site specific wp-config.php file rather than easyengine.conf.
This caused a critical error to occur when using a external mysql GRANT host established in easyengine.conf, as the MySQL database host was stored in wp-config.php which would not be the same as the granted host/IP (as the granted IP would traditionally be the webserver). This critical error would leave the system in an incongruent state, as the database would have been dropped, but the MySQL user+ Nginx configuration + web root would not be touched.
This simply checks if ee_lib_variables.sh changed the constant $EE_MYSQL_GRANT_HOST, and if it has been changed, modifies the ee_db_host variable to match.