1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/netdata_ynh.git synced 2024-09-03 19:46:33 +02:00

Fix backup and restore scripts

This commit is contained in:
Jimmy Monin 2017-12-27 10:43:23 +01:00
parent cd1979b58e
commit a2155e224b
2 changed files with 21 additions and 21 deletions

View file

@ -2,13 +2,6 @@
#=================================================
# GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -21,6 +14,13 @@ fi
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================

View file

@ -2,13 +2,6 @@
#=================================================
# GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -21,6 +14,13 @@ fi
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
@ -55,9 +55,15 @@ ynh_install_app_dependencies $pkg_dependencies
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
# Restore configuration files
ynh_restore_file "/opt/netdata/etc/netdata"
# Restore permissions to app files
chown -R root: "/opt/netdata/etc/netdata"
# Retrieve app.src from archive for ynh_setup_source helper
mkdir ../conf
cp opt/netdata/etc/netdata/app.src ../conf
cp /opt/netdata/etc/netdata/app.src ../conf
# Download, check integrity, uncompress and patch the source from app.src
NETDATA_TMPDIR=$(mktemp -d)
@ -73,12 +79,6 @@ cd $NETDATA_TMPDIR
configure_netdata
# Restore configuration files
ynh_restore_file "/opt/netdata/etc/netdata"
# Restore permissions to app files
chown -R root: "/opt/netdata/etc/netdata"
#=================================================
# GENERIC FINALISATION
#=================================================