2023-04-03 21:32:47 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
2023-12-04 20:16:42 +01:00
|
|
|
weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider)
|
|
|
|
weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key)
|
2023-04-03 21:32:47 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD UPGRADE STEPS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --action="stop" --service_name="${app}"
|
|
|
|
ynh_systemd_action --action="stop" --service_name="${app}_workers"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY THE CONFIG FILE
|
|
|
|
#=================================================
|
2023-09-14 19:16:04 +02:00
|
|
|
ynh_script_progression --message="Modifying a config file..." --weight=1
|
2023-04-03 21:32:47 +02:00
|
|
|
|
2023-09-14 19:16:04 +02:00
|
|
|
domain=$new_domain
|
2023-09-25 09:19:31 +02:00
|
|
|
ynh_add_config --template="../conf/.env.production" --destination="$install_dir/.env"
|
2023-04-03 21:32:47 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting the systemd services..." --weight=15
|
|
|
|
|
|
|
|
# Start a systemd service
|
|
|
|
ynh_systemd_action --service_name="${app}" --action="start"
|
|
|
|
ynh_systemd_action --service_name="${app}_workers" --action="start"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|