mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
72 lines
2.4 KiB
Bash
72 lines
2.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
admin=$(ynh_user_get_info --username=$admin --key=username)
|
|
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
|
|
|
if [ -z "${weather_api_provider:-}" ]; then
|
|
weather_api_provider=$weather_provider
|
|
ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider
|
|
fi
|
|
|
|
if [ -z "${weather_api_key:-}" ]; then
|
|
weather_api_key=$weather_key
|
|
ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key
|
|
fi
|
|
|
|
if [ -z "${redis_db:-}" ]; then
|
|
redis_db=$(ynh_redis_get_free_db)
|
|
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
|
|
fi
|
|
|
|
#=================================================
|
|
# 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
|
|
#=================================================
|
|
ynh_script_progression --message="Modifying a config file..." --weight=1
|
|
|
|
domain=$new_domain
|
|
ynh_add_config --template="../conf/.env.production" --destination="$install_dir/.env"
|
|
|
|
#=================================================
|
|
# 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
|