2014-10-20 18:55:53 +02:00
|
|
|
#!/bin/bash
|
2015-10-27 16:03:21 +01:00
|
|
|
|
2017-06-02 18:44:37 +02:00
|
|
|
#=================================================
|
2017-06-17 18:02:28 +02:00
|
|
|
# GENERIC START
|
2017-06-02 18:44:37 +02:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2017-06-05 13:06:35 +02:00
|
|
|
source _common.sh
|
2017-06-02 18:44:37 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2019-04-18 19:58:47 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK VERSION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
|
2021-05-09 20:26:00 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD UPGRADE STEPS
|
2021-03-17 16:32:11 +01:00
|
|
|
#=================================================
|
|
|
|
|
2017-06-02 18:44:37 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
|
2019-04-18 19:58:47 +02:00
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
|
then
|
2021-09-18 13:39:41 +02:00
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
2019-04-18 19:58:47 +02:00
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-01-17 17:03:19 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2019-04-18 19:58:47 +02:00
|
|
|
fi
|
2017-06-02 18:44:37 +02:00
|
|
|
|
2023-01-17 17:03:19 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-03-17 16:32:11 +01:00
|
|
|
|
2017-06-02 18:44:37 +02:00
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-09-18 13:39:41 +02:00
|
|
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
2017-06-02 18:44:37 +02:00
|
|
|
|
2020-08-02 16:00:17 +02:00
|
|
|
# Create a dedicated NGINX config
|
2018-05-27 15:44:58 +02:00
|
|
|
ynh_add_nginx_config
|
2018-06-28 22:05:35 +02:00
|
|
|
|
2019-02-10 15:02:38 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-09-18 13:39:41 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|