Handle config checksums in change_url scripts

This commit is contained in:
selfhoster1312 2023-01-10 19:03:54 +01:00
parent a47af1ed63
commit db2eefa498

View file

@ -49,10 +49,18 @@ rp_validate_assets_path
# Special case for "/" path_url # Special case for "/" path_url
rp_handle_webroot rp_handle_webroot
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
ynh_add_nginx_config ynh_add_nginx_config
# Move file to new domain if domain has changed # Move file to new domain if domain has changed
[[ "$old_domain" != "$new_domain" ]] && mv /etc/nginx/conf.d/$old_domain.d/$app.conf /etc/nginx/conf.d/$new_domain.d/$app.conf if [[ "$old_domain" != "$new_domain" ]]; then
new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
ynh_delete_file_checksum --file="$nginx_conf_path"
mv $nginx_conf_path $new_nginx_conf_path
ynh_store_file_checksum --file="$new_nginx_conf_path"
fi
#================================================= #=================================================