diff --git a/scripts/backup b/scripts/backup index a973630..3d1459f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -4,12 +4,9 @@ set -eu app=$YNH_APP_INSTANCE_NAME -# Set app specific variables - dbname=$app - dbuser=$app - # Source app helpers source /usr/share/yunohost/helpers + source .fonctions # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) @@ -26,6 +23,10 @@ # Copy dedicated php-fpm process to backup folder ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf" +# Set app specific variables + dbname=$app + dbuser=$app + # Dump the database mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql ynh_backup "db.sql" "dump.sql" diff --git a/scripts/restore b/scripts/restore index 06d71dc..7fd25f2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,6 +8,7 @@ # Source app helpers source /usr/share/yunohost/helpers + source .fonctions # Retrieve old app settings domain=$(ynh_app_setting_get "$app" domain) diff --git a/scripts/upgrade b/scripts/upgrade index 9f8a3c4..c1410eb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -2,6 +2,10 @@ app=$YNH_APP_INSTANCE_NAME rainloop_version=$(cat ../sources/rainloop_version) +# Source app helpers + source /usr/share/yunohost/helpers + source .fonctions + # Backup the current version of the app, restore it if the upgrade fails # Check if old backup exists if sudo yunohost backup list | grep -q $app-before-upgrade > /dev/null 2>&1; @@ -20,10 +24,6 @@ set -eu trap EXIT_PROPERLY ERR -# Source app helpers - source /usr/share/yunohost/helpers - source .fonctions - # Retrieve arguments domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path)