1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/horde_ynh.git synced 2024-09-03 19:16:08 +02:00
horde_ynh/scripts/upgrade

77 lines
2.5 KiB
Text
Raw Normal View History

2018-02-06 14:33:23 +01:00
#!/bin/bash
2018-02-11 00:32:26 +01:00
#=================================================
# GENERIC START
#=================================================
2018-02-06 14:33:23 +01:00
# IMPORT GENERIC HELPERS
2022-03-09 00:27:32 +01:00
#=================================================
source _common.sh
2018-02-06 14:33:23 +01:00
source /usr/share/yunohost/helpers
2022-03-09 00:27:32 +01:00
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
2022-08-31 00:06:07 +02:00
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
2022-03-09 00:27:32 +01:00
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
2022-08-31 00:06:07 +02:00
# Create a dedicated NGINX config
config_nginx
2022-03-09 00:27:32 +01:00
#=================================================
# SPECIFIC UPGRADE
#=================================================
2022-08-31 00:06:07 +02:00
# UPGRADE SOURCE FILE
2022-03-09 00:27:32 +01:00
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=6
2022-08-31 00:06:07 +02:00
2023-11-02 22:33:38 +01:00
pear_cmd="$install_dir/pear/pear -c $install_dir/pear.conf"
2018-02-06 14:33:23 +01:00
$pear_cmd channel-update pear.horde.org
2023-11-02 22:33:38 +01:00
$pear_cmd upgrade -R $install_dir -a -B -c pear.horde.org || true
2018-02-06 14:33:23 +01:00
2022-08-31 00:06:07 +02:00
#=================================================
# PATCH APPLICATION
#=================================================
ynh_script_progression --message="Patching application..." --weight=7
2022-08-31 00:06:07 +02:00
2018-02-06 14:33:23 +01:00
patch_app
2022-08-31 00:06:07 +02:00
#=================================================
# CONFIGURE HORDE
#=================================================
ynh_script_progression --message="Configuring application..." --weight=3
2022-08-31 00:06:07 +02:00
2018-02-06 14:33:23 +01:00
config_horde
2022-08-31 00:06:07 +02:00
#=================================================
2018-02-06 14:33:23 +01:00
# SECURE FILES AND DIRECTORIES
2022-08-31 00:06:07 +02:00
#=================================================
ynh_script_progression --message="Protecting directory..."
2022-08-31 00:06:07 +02:00
2018-07-31 17:04:14 +02:00
set_permission
2022-03-09 00:27:32 +01:00
#=================================================
# GENERIC FINALIZATION
#=================================================
2018-07-31 17:04:14 +02:00
# SETUP LOGROTATE
2022-03-09 00:27:32 +01:00
#=================================================
2022-08-31 00:06:07 +02:00
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
2022-03-09 00:27:32 +01:00
2023-11-02 22:33:38 +01:00
ynh_use_logrotate --logfile="$install_dir/horde" --nonappend --specific_user www-data/horde
ynh_use_logrotate --logfile="$install_dir/horde/services" --specific_user www-data/horde
ynh_use_logrotate --logfile="$install_dir/horde/services/portal" --specific_user www-data/horde
2022-03-09 00:27:32 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2022-08-31 00:06:07 +02:00
ynh_script_progression --message="Upgrade of $app completed" --last