2013-12-11 21:23:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-10-20 23:28:09 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
2017-03-08 23:34:00 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-13 22:29:15 +02:00
|
|
|
|
2021-06-20 18:24:46 +02:00
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
|
2021-07-21 15:23:29 +02:00
|
|
|
#=================================================
|
|
|
|
# ENSURE DOWNWARD COMPATIBILITY
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
2021-06-20 18:24:46 +02:00
|
|
|
|
2020-11-22 22:56:21 +01:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
|
2024-01-07 13:10:56 +01:00
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]; then
|
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2021-06-20 18:24:46 +02:00
|
|
|
fi
|
2020-11-22 22:56:21 +01:00
|
|
|
|
2024-01-07 13:10:56 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2021-07-21 14:51:44 +02:00
|
|
|
|
2020-11-22 22:56:21 +01:00
|
|
|
#=================================================
|
|
|
|
# Set Jappix configuration
|
|
|
|
#=================================================
|
2021-08-23 10:30:40 +02:00
|
|
|
ynh_script_progression --message="Configuring Jappix..." --weight=1
|
2020-11-22 22:24:16 +01:00
|
|
|
|
2024-01-07 13:10:56 +01:00
|
|
|
mkdir -p "$install_dir/store/conf"
|
|
|
|
|
|
|
|
ynh_add_config --template="../conf/hosts.xml" --destination="$install_dir/store/conf/hosts.xml"
|
|
|
|
ynh_add_config --template="../conf/main.xml" --destination="$install_dir/store/conf/main.xml"
|
|
|
|
ynh_add_config --template="../conf/installed.xml" --destination="$install_dir/store/conf/installed.xml"
|
2021-07-21 15:46:34 +02:00
|
|
|
|
2024-01-07 13:10:56 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2020-10-20 23:28:09 +02:00
|
|
|
|
|
|
|
#=================================================
|
2024-01-07 13:10:56 +01:00
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
2020-10-20 23:28:09 +02:00
|
|
|
#=================================================
|
2024-01-07 13:10:56 +01:00
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
2020-10-20 23:28:09 +02:00
|
|
|
|
2024-01-07 13:10:56 +01:00
|
|
|
# Create a dedicated nginx config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
# Create a dedicated PHP-FPM config
|
|
|
|
ynh_add_fpm_config
|
2020-10-20 23:28:09 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-11-22 22:17:57 +01:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|