2016-05-04 14:17:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-04-20 19:34:26 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -eu
|
2016-05-04 14:17:07 +02:00
|
|
|
|
2016-05-07 02:00:48 +02:00
|
|
|
# Source YNH helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
|
2017-04-20 19:34:26 +02:00
|
|
|
# Get multi-instances specific variables
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2016-05-07 02:00:48 +02:00
|
|
|
|
2017-04-20 19:34:26 +02:00
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
2016-05-04 14:17:07 +02:00
|
|
|
|
|
|
|
# Backup directory location for the app from where the script is executed and
|
|
|
|
# which will be compressed afterward
|
|
|
|
backup_dir=$YNH_APP_BACKUP_DIR
|
|
|
|
|
|
|
|
# Copy the conf files
|
|
|
|
sudo mkdir -p ./conf
|
2017-04-20 19:34:26 +02:00
|
|
|
ynh_backup "/etc/default/${app}" "./conf/default_${app}"
|
2016-05-07 02:00:48 +02:00
|
|
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" ./conf/nginx.conf
|