1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/distbin_ynh.git synced 2024-09-03 18:26:10 +02:00

Fix change_url

This commit is contained in:
yalh76 2020-08-10 02:12:03 +02:00
parent ddd8b635c9
commit 52c361116a

View file

@ -112,14 +112,30 @@ fi
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying config file..."
ynh_print_info --message="Modifying config file..."
ynh_use_nodejs
config="$final_path/.env"
ynh_backup_if_checksum_is_different --file="$config"
domain="$new_domain"
path_url="$new_path"
# Change the URL in the configuration file
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
if [ "$new_path" == "/" ]
then
new_domain_uri="$new_domain"
else
new_domain_uri="$new_domain$new_path"
fi
ynh_replace_string --match_string="EXTERNAL_URL=.*" --replace_string="EXTERNAL_URL=https://$new_domain_uri/" --target_file="$config"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_print_info --message="Storing the config file checksum..."
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config"
#=================================================
# GENERIC FINALISATION