1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00

source .fonctions in every file

This commit is contained in:
polytan02 2017-02-24 22:16:26 +00:00
parent 90f7650c29
commit 7c9f6ab660
3 changed files with 10 additions and 8 deletions

View file

@ -4,12 +4,9 @@
set -eu set -eu
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Set app specific variables
dbname=$app
dbuser=$app
# Source app helpers # Source app helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
source .fonctions
# Retrieve app settings # Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
@ -26,6 +23,10 @@
# Copy dedicated php-fpm process to backup folder # Copy dedicated php-fpm process to backup folder
ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf" ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
# Set app specific variables
dbname=$app
dbuser=$app
# Dump the database # Dump the database
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql
ynh_backup "db.sql" "dump.sql" ynh_backup "db.sql" "dump.sql"

View file

@ -8,6 +8,7 @@
# Source app helpers # Source app helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
source .fonctions
# Retrieve old app settings # Retrieve old app settings
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)

View file

@ -2,6 +2,10 @@
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
rainloop_version=$(cat ../sources/rainloop_version) 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 # Backup the current version of the app, restore it if the upgrade fails
# Check if old backup exists # Check if old backup exists
if sudo yunohost backup list | grep -q $app-before-upgrade > /dev/null 2>&1; if sudo yunohost backup list | grep -q $app-before-upgrade > /dev/null 2>&1;
@ -20,10 +24,6 @@
set -eu set -eu
trap EXIT_PROPERLY ERR trap EXIT_PROPERLY ERR
# Source app helpers
source /usr/share/yunohost/helpers
source .fonctions
# Retrieve arguments # Retrieve arguments
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path) path=$(ynh_app_setting_get "$app" path)