mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
57 lines
No EOL
1.8 KiB
Bash
57 lines
No EOL
1.8 KiB
Bash
#!/bin/bash
|
|
|
|
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)
|
|
|
|
ynh_app_setting_set_default --key=weather_api_provider --value=$weather_provider
|
|
|
|
ynh_app_setting_set_default --key=weather_api_key --value=$weather_key
|
|
|
|
ynh_app_setting_set_default --key=redis_db --value=$(ynh_redis_get_free_db)
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
|
|
|
ynh_systemctl --action="stop" --service="${app}"
|
|
|
|
ynh_systemctl --action="stop" --service="${app}_workers"
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
|
|
|
ynh_config_change_url_nginx
|
|
|
|
#=================================================
|
|
# MODIFY THE CONFIG FILE
|
|
#=================================================
|
|
ynh_script_progression "Updating configuration..."
|
|
|
|
domain=$new_domain
|
|
ynh_config_add --template=".env.production" --destination="$install_dir/.env"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Starting the systemd services..."
|
|
|
|
# Start a systemd service
|
|
ynh_systemctl --service="${app}" --action="start"
|
|
|
|
ynh_systemctl --service="${app}_workers" --action="start"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression "Upgrade of $app completed" |