2018-04-23 22:40:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2021-05-01 08:52:00 +02:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2018-04-23 22:40:01 +02:00
|
|
|
|
2024-01-03 21:39:54 +01:00
|
|
|
ynh_change_url_nginx_config
|
2018-04-23 22:40:01 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2019-06-01 19:22:51 +02:00
|
|
|
# MOVE FOLDER IF NECESSARY
|
2018-04-23 22:40:01 +02:00
|
|
|
#=================================================
|
2024-01-03 21:39:54 +01:00
|
|
|
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
2018-04-23 22:40:01 +02:00
|
|
|
|
2021-05-01 08:52:00 +02:00
|
|
|
# Change the domain for NGINX
|
2024-01-03 21:39:54 +01:00
|
|
|
if [ "$change_domain" -eq 1 ]; then
|
|
|
|
# Delete file checksum for the old conf file location
|
|
|
|
ynh_delete_file_checksum --file="$install_dir/sites/$old_domain/config.json"
|
|
|
|
mv "$install_dir/sites/$old_domain" "$install_dir/sites/$new_domain"
|
|
|
|
# Store file checksum for the new config file location
|
|
|
|
ynh_store_file_checksum --file="$install_dir/sites/$new_domain/config.json"
|
2019-06-01 19:22:51 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2018-04-23 22:40:01 +02:00
|
|
|
|
2019-06-01 19:22:51 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|