2017-10-28 19:28:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2020-06-28 23:43:03 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK VERSION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
2017-10-28 19:28:51 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD UPGRADE STEPS
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
|
2020-06-28 23:43:03 +02:00
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=3
|
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-05-07 18:50:05 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2020-06-28 23:43:03 +02:00
|
|
|
fi
|
2017-10-28 19:28:51 +02:00
|
|
|
|
2021-06-02 22:38:01 +02:00
|
|
|
# Set right permissions for curl installation
|
2023-05-07 18:50:05 +02:00
|
|
|
chmod 750 $install_dir
|
|
|
|
chown -R www-data: $install_dir
|
2021-06-02 22:38:01 +02:00
|
|
|
|
2017-10-28 19:28:51 +02:00
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2020-11-17 09:08:16 +01:00
|
|
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
2017-10-28 19:28:51 +02:00
|
|
|
|
2020-11-17 09:08:16 +01:00
|
|
|
# Create a dedicated NGINX config
|
2017-10-28 19:28:51 +02:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2020-06-28 23:43:03 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2017-10-28 19:28:51 +02:00
|
|
|
|
2020-06-28 23:43:03 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|