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