2017-12-24 14:28:25 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
2022-03-13 15:22:35 +01:00
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
|
|
|
|
2020-11-17 23:51:51 +01:00
|
|
|
# Import common cmd
|
2022-03-13 15:22:35 +01:00
|
|
|
source experimental_helper.sh
|
|
|
|
source _common.sh
|
2017-12-24 14:28:25 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
2024-01-30 17:03:58 +01:00
|
|
|
# STANDARD MODIFICATIONS
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
2024-01-30 17:03:58 +01:00
|
|
|
# STOP SYSTEMD SERVICE
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
2024-01-30 17:03:58 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2022-03-13 15:22:35 +01:00
|
|
|
|
2024-01-30 17:03:58 +01:00
|
|
|
ynh_systemd_action --service_name="uwsgi-app@$app.service" --action="stop" --log_path="/var/log/uwsgi/$app/$app.log"
|
2017-12-24 14:28:25 +01:00
|
|
|
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
|
|
|
|
2024-01-30 11:36:14 +01:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2022-03-17 19:49:51 +01:00
|
|
|
# UPDATE CONFIGURATION
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
2022-03-17 19:49:51 +01:00
|
|
|
ynh_script_progression --message="Updating configuration..."
|
2022-03-14 22:15:43 +01:00
|
|
|
|
2017-12-24 14:28:25 +01:00
|
|
|
# Update UWSGI Config
|
2024-01-30 18:01:57 +01:00
|
|
|
ynh_add_uwsgi_service "python_version"
|
2017-12-24 14:28:25 +01:00
|
|
|
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
|
|
|
|
|
|
|
# Start a systemd service
|
2022-03-14 22:15:43 +01:00
|
|
|
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"
|
2020-07-30 22:55:35 +02:00
|
|
|
sleep 10
|
2019-06-06 22:39:49 +02:00
|
|
|
|
2022-03-13 15:22:35 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2019-06-11 22:27:54 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|