2014-11-25 22:12:15 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-05-07 01:44:03 +02:00
|
|
|
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
|
2017-03-08 23:31:31 +01:00
|
|
|
set -eu
|
2016-05-07 01:44:03 +02:00
|
|
|
|
|
|
|
# Source YNH helpers
|
2017-03-08 23:31:31 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-07 01:44:03 +02:00
|
|
|
|
2017-03-08 23:31:31 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2016-05-07 01:44:03 +02:00
|
|
|
|
|
|
|
# Retrieve app settings
|
2017-03-08 23:31:31 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2016-05-07 01:44:03 +02:00
|
|
|
|
|
|
|
# Save sources & data
|
|
|
|
ynh_backup "/var/www/${app}" "sources"
|
|
|
|
|
|
|
|
# Copy NGINX configuration
|
|
|
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
|