2022-07-11 20:34:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-10-04 10:20:28 +02:00
|
|
|
ynh_script_progression --message="Stopping systemd service '$app'..."
|
2022-07-11 20:34:24 +02:00
|
|
|
|
2024-06-17 21:12:19 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="$log_file"
|
2022-07-11 20:34:24 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2024-06-17 21:12:19 +02:00
|
|
|
ynh_script_progression --message="Updating nginx web server configuration..."
|
2022-07-11 20:34:24 +02:00
|
|
|
|
2024-01-18 21:02:26 +01:00
|
|
|
ynh_change_url_nginx_config
|
2022-07-11 20:34:24 +02:00
|
|
|
|
|
|
|
#=================================================
|
2024-06-17 21:12:19 +02:00
|
|
|
# UPDATE DJANGO SETTINGS
|
2022-07-11 20:34:24 +02:00
|
|
|
#=================================================
|
2024-06-17 21:12:19 +02:00
|
|
|
ynh_script_progression --message="Update $app settings file..." --weight=1
|
2022-10-04 10:20:28 +02:00
|
|
|
|
2024-06-17 21:12:19 +02:00
|
|
|
path=$new_path
|
|
|
|
domain=$new_domain
|
|
|
|
|
|
|
|
ynh_add_config --template="settings.py" --destination="$data_dir/settings.py"
|
2022-07-11 20:34:24 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-10-04 10:20:28 +02:00
|
|
|
ynh_script_progression --message="Starting systemd service '$app'..." --weight=5
|
2022-07-11 20:34:24 +02:00
|
|
|
|
2024-06-17 21:12:19 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="$log_file"
|
2022-07-11 20:34:24 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|