[enh] Some corrections

This commit is contained in:
Maniack Crudelis
2017-08-28 23:55:51 +02:00
parent b4c6969284
commit a625ad79da
10 changed files with 42 additions and 134 deletions

View File

@@ -27,19 +27,37 @@ db_name=$(ynh_app_setting_get $app db_name)
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set $app is_public 1 # Fix is_public as a boolean value
ynh_app_setting_set $app is_public 1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set $app is_public 0
is_public=0
fi
if [ -z $db_name ]; then # If db_name doesn't exist, create it
# If db_name doesn't exist, create it
if [ -z $db_name ]; then
db_name=$(ynh_sanitize_dbid $app)
ynh_app_setting_set $app db_name $db_name
fi
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=$(ynh_sanitize_dbid $app)
ynh_app_setting_set $app final_path $final_path
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_backup_before_upgrade # Backup the current version of the app
ynh_clean_setup () {
ynh_restore_upgradebackup # restore it if the upgrade fails
}
ynh_abort_if_errors # Exit if an error occurs during the execution of the script
#=================================================
# CHECK THE PATH
#=================================================
@@ -75,7 +93,7 @@ ynh_system_user_create $app
#=================================================
# Create a dedicated php-fpm config
ynh_fpm_config
ynh_add_fpm_config
#=================================================
# SPECIFIC UPGRADE