#!/bin/bash #================================================= # GENERIC START #================================================= # Import common cmd source ./experimental_helper.sh source ./_common.sh # Source YunoHost helpers source /usr/share/yunohost/helpers # Stop script if errors ynh_abort_if_errors # Retrive arguments ynh_script_progression --message="Loading installation settings..." old_domain=$YNH_APP_OLD_DOMAIN domain=$YNH_APP_NEW_DOMAIN path_url=$(ynh_normalize_url_path --path_url $YNH_APP_NEW_PATH) #================================================= # STANDARD MODIFICATIONS #================================================= ynh_script_progression --message="Updating configuration..." # Update nginx config if [ "$old_domain" != "$domain" ] then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file "/etc/nginx/conf.d/$old_domain.d/$app.conf" mv "/etc/nginx/conf.d/$old_domain.d/$app.conf" "/etc/nginx/conf.d/$domain.d/$app.conf" # Store file checksum for the new config file location ynh_store_file_checksum --file "/etc/nginx/conf.d/$domain.d/$app.conf" fi ynh_add_nginx_config # Update UWSGI Config ynh_add_uwsgi_service 'pgadmin_user python_version' # Reload services ynh_script_progression --message="Restarting $app services..." --weight=3 ynh_systemd_action --service_name "uwsgi-app@$app.service" --action restart \ --line_match "WSGI app 0 \(mountpoint='[/[:alnum:]_-]*'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/$app.log" sleep 10 ynh_script_progression --message="Change of URL completed for $app" --last