django-for-runners_ynh/scripts/change_url
Jens Diemer 179765f117 Apply manageprojects updates
https://github.com/jedie/cookiecutter_templates/#base-django-yunohost-app migrated from Poetry to
pip-tools and to manifest v2

Apply these changes here.
2023-11-09 20:46:24 +01:00

49 lines
1.6 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping systemd service '$app'..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="$log_file"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating nginx web server configuration..."
ynh_change_url_nginx_config
#=================================================
# UPDATE DJANGO SETTINGS
#=================================================
ynh_script_progression --message="Update $app settings file..." --weight=1
path=$new_path
domain=$new_domain
ynh_add_config --template="settings.py" --destination="$data_dir/settings.py"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting systemd service '$app'..." --weight=5
ynh_systemd_action --service_name=$app --action="start" --log_path="$log_file"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last