mirror of
https://github.com/YunoHost-Apps/leed_ynh.git
synced 2024-09-03 19:26:32 +02:00
39 lines
1.4 KiB
Bash
39 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
ynh_script_progression --message="Updating configuration files..." --weight=1
|
|
|
|
ynh_replace_string --match_string="https://$old_domain$old_path" --replace_string="https://$domain$path" --target_file="/etc/cron.d/$app"
|
|
|
|
#=================================================
|
|
# UPDATE THE DATABASE
|
|
#=================================================
|
|
ynh_script_progression --message="Updating the database..." --weight=1
|
|
|
|
ynh_mysql_execute_as_root --database="$app" --sql="UPDATE leed_configuration SET value='$domain$path/' WHERE value LIKE '%${old_domain}%'"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|