diff --git a/scripts/backup b/scripts/backup index 3c52289..8eef115 100755 --- a/scripts/backup +++ b/scripts/backup @@ -2,12 +2,6 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_abort_if_errors - #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -17,9 +11,12 @@ if [ ! -e _common.sh ]; then cp ../settings/scripts/_common.sh ./_common.sh chmod a+rx _common.sh fi + source _common.sh source /usr/share/yunohost/helpers +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/restore b/scripts/restore index 0ab61e6..c258791 100755 --- a/scripts/restore +++ b/scripts/restore @@ -2,19 +2,21 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_abort_if_errors - #================================================= # IMPORT GENERIC HELPERS #================================================= +if [ ! -e _common.sh ]; then + # Get the _common.sh file if it's not in the current directory + cp ../settings/scripts/_common.sh ./_common.sh + chmod a+rx _common.sh +fi + source _common.sh source /usr/share/yunohost/helpers +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #=================================================