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

41 lines
1.5 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
#=================================================
# MOVE FOLDER IF NECESSARY
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1
# Change the domain for NGINX
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"
fi
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last