2019-02-21 10:52:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-16 17:45:38 +02:00
|
|
|
source _common.sh
|
2019-02-21 10:52:01 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2020-10-10 19:02:26 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK VERSION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
2019-02-21 10:52:01 +01:00
|
|
|
|
|
|
|
#=================================================
|
2020-10-10 19:02:26 +02:00
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
2019-02-21 10:52:01 +01:00
|
|
|
#=================================================
|
|
|
|
|
2020-10-10 19:02:26 +02:00
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=4
|
2019-02-21 10:52:01 +01:00
|
|
|
|
2023-06-13 18:24:54 +02:00
|
|
|
ynh_secure_remove --file=$install_dir
|
2020-10-10 19:02:26 +02:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-11-10 10:33:05 +01:00
|
|
|
mv ../sources/dist/ "$install_dir"
|
2020-10-10 19:02:26 +02:00
|
|
|
fi
|
2019-02-21 10:52:01 +01:00
|
|
|
|
2023-06-13 18:21:12 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-05-16 17:45:38 +02:00
|
|
|
|
2019-02-21 10:52:01 +01:00
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2020-10-10 19:02:26 +02:00
|
|
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
2019-02-21 10:52:01 +01:00
|
|
|
|
2021-05-16 17:45:38 +02:00
|
|
|
# Create a dedicated NGINX config
|
2019-02-21 10:52:01 +01:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-16 17:45:38 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|