2019-10-15 15:56:27 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2020-10-13 18:23:23 +02:00
|
|
|
|
2019-10-15 15:56:27 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
2020-10-13 18:23:23 +02:00
|
|
|
|
2019-10-15 15:56:27 +02:00
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2020-10-13 18:23:23 +02:00
|
|
|
ynh_print_info --message="Loading installation settings..."
|
2019-10-15 15:56:27 +02:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
2021-09-30 15:40:24 +02:00
|
|
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|
|
|
superuser=$(ynh_app_setting_get --app=$app --key=superuser)
|
|
|
|
password=$(ynh_app_setting_get --app=$app --key=password)
|
2019-10-15 15:56:27 +02:00
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2021-09-30 15:40:24 +02:00
|
|
|
conf_dir=$(ynh_app_setting_get --app=$app --key=conf_dir)
|
|
|
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
|
|
|
stream_port=$(ynh_app_setting_get --app=$app --key=stream_port)
|
2019-10-15 15:56:27 +02:00
|
|
|
|
|
|
|
#=================================================
|
2020-10-13 18:23:23 +02:00
|
|
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
2019-10-15 15:56:27 +02:00
|
|
|
#=================================================
|
2020-10-13 18:23:23 +02:00
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
2019-10-15 15:56:27 +02:00
|
|
|
|
|
|
|
#=================================================
|
2019-10-23 10:16:15 +02:00
|
|
|
# BACKUP THE APP MAIN DIR AND CONFIG FILES
|
2019-10-15 15:56:27 +02:00
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/default/tvheadend"
|
2019-10-23 10:16:15 +02:00
|
|
|
ynh_backup --src_path="$final_path"
|
2019-10-15 15:56:27 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2020-10-13 18:23:23 +02:00
|
|
|
ynh_print_info --message="Backup script completed for Tvheadend. (YunoHost will then actually copy those files to the archive)."
|