2017-10-22 01:11:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2021-02-07 11:01:22 +01:00
|
|
|
#=================================================
|
|
|
|
# CHECK VERSION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
|
2017-10-22 01:11:59 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
|
2021-02-07 11:01:22 +01:00
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
2018-06-04 15:14:50 +02:00
|
|
|
|
2021-02-07 11:01:22 +01:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-09-01 22:10:13 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir" --keep="config.php"
|
2021-02-07 11:01:22 +01:00
|
|
|
fi
|
2017-10-25 17:44:34 +02:00
|
|
|
|
2023-09-02 12:06:13 +02:00
|
|
|
chmod 755 -R $install_dir
|
|
|
|
chmod -R o-rwx $install_dir
|
|
|
|
chown -R $app:www-data $install_dir
|
2022-07-15 17:39:22 +02:00
|
|
|
|
2018-06-04 15:14:50 +02:00
|
|
|
#=================================================
|
|
|
|
# PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2021-01-26 09:41:19 +01:00
|
|
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
|
2018-06-04 15:14:50 +02:00
|
|
|
|
2022-07-15 23:07:40 +02:00
|
|
|
# Create a dedicated PHP-FPM config
|
2023-09-01 22:18:33 +02:00
|
|
|
ynh_add_fpm_config --usage=low --footprint=low
|
2022-07-15 17:20:21 +02:00
|
|
|
|
|
|
|
# Create a dedicated nginx config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2019-04-05 20:58:52 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-01-26 09:03:08 +01:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed"
|