1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

Attempt to fix the change url thing, we don't need the maintenance mode, this thing is expected to take just a few seconds ...

This commit is contained in:
Alexandre Aubin 2023-12-19 01:10:29 +01:00
parent b89259c425
commit 5916ff0dbd

View file

@ -1,11 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -19,25 +13,10 @@ then
ynh_die --message="https://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite" ynh_die --message="https://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite"
fi fi
#=================================================
# ACTIVATE MAINTENANCE MODE
#=================================================
path=$old_path
domain=$old_domain
ynh_maintenance_mode_ON
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3
ynh_change_url_nginx_config ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#================================================= #=================================================
# UPDATE THE DATABASE # UPDATE THE DATABASE
#================================================= #=================================================
@ -48,14 +27,6 @@ db_prefix=$(grep '^$table_prefix' "$install_dir/wp-config.php" | sed "s/.*'\(.*\
ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='siteurl'" --database=$app ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='siteurl'" --database=$app
ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='home'" --database=$app ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='home'" --database=$app
#=================================================
# DEACTIVE MAINTENANCE MODE
#=================================================
path=$old_path
domain=$old_domain
ynh_maintenance_mode_OFF
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================