1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shellinabox_ynh.git synced 2024-09-03 20:26:12 +02:00
shellinabox_ynh/scripts/backup
2017-04-20 19:34:26 +02:00

21 lines
No EOL
571 B
Bash

#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers
# Get multi-instances specific variables
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
# 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
ynh_backup "/etc/default/${app}" "./conf/default_${app}"
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" ./conf/nginx.conf