mirror of
https://github.com/YunoHost-Apps/alltube_ynh.git
synced 2024-09-03 18:06:12 +02:00
better way to detect fpm version
This commit is contained in:
parent
9ffbf5ff15
commit
86f28fc52b
3 changed files with 14 additions and 17 deletions
|
@ -10,16 +10,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
current_version=$(yunohost app info alltube | grep version | cut -d ':' -f 2)
|
||||
current_version=${current_version/ /''}
|
||||
|
||||
if [ "2.2.1~ynh1" != "`echo -e "2.2.1~ynh1\n$current_version" | sort -V | head -n1`" ]; then
|
||||
CURRENT_PHP_VERSION="7.0"
|
||||
else
|
||||
CURRENT_PHP_VERSION="7.3"
|
||||
fi
|
||||
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
@ -37,6 +27,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
fpm_config_dir=$(ynh_app_setting_get $app fpm_config_dir)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
|
@ -59,7 +50,7 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Backing up php-fpm configuration..." --weight=1
|
||||
|
||||
ynh_backup "/etc/php/$CURRENT_PHP_VERSION/fpm/pool.d/$app.conf"
|
||||
ynh_backup "$fpm_config_dir/pool.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -29,6 +29,8 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get $app domain)
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
fpm_config_dir=$(ynh_app_setting_get $app fpm_config_dir)
|
||||
fpm_service=$(ynh_app_setting_get $app fpm_service)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -75,7 +77,7 @@ chown -R alltube: $final_path/templates_c/
|
|||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf"
|
||||
ynh_restore_file --origin_path="$fpm_config_dir/pool.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
@ -85,8 +87,13 @@ ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf"
|
|||
ynh_script_progression --message="Reinstalling dependencies.." --weight=60
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependencies"
|
||||
if [ "$fpm_service" = "php7.0-fpm" ]; then
|
||||
apt_dependencies=$(ynh_app_setting_get $app apt_dependencies)
|
||||
ynh_install_app_dependencies $apt_dependencie
|
||||
else
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependencies"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -22,6 +22,7 @@ domain=$(ynh_app_setting_get $app domain)
|
|||
path_url=$(ynh_app_setting_get $app path)
|
||||
is_public=$(ynh_app_setting_get $app is_public)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
fpm_service=$(ynh_app_setting_get $app fpm_service)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
|
@ -37,14 +38,12 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
current_version=$(yunohost app info alltube | grep version | cut -d ':' -f 2)
|
||||
current_version=${current_version/ /''}
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility.." --weight=1
|
||||
|
||||
if [ "2.2.1~ynh1" != "`echo -e "2.2.1~ynh1\n$current_version" | sort -V | head -n1`" ]; then
|
||||
if [ "$fpm_service" = "php7.0-fpm" ]; then
|
||||
ynh_remove_fpm_config
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue