From 44f0706c9ad15dc70a7b1117bd88bc66ca4ad58f Mon Sep 17 00:00:00 2001 From: Krakinou Date: Thu, 27 Dec 2018 23:28:51 +0100 Subject: [PATCH] Correct Restore script --- scripts/backup | 8 ++++++-- scripts/restore | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index 1068e4b..ec08995 100755 --- a/scripts/backup +++ b/scripts/backup @@ -5,8 +5,12 @@ #================================================= # IMPORT GENERIC HELPERS #================================================= - -source ../settings/scripts/_common.sh +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 #================================================= diff --git a/scripts/restore b/scripts/restore index 74b1e07..8cd9dcb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= -source ../settings/scripts/_common.sh +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 #================================================= @@ -124,7 +129,7 @@ else fi #Check if metadata.db file exists. If not create it (empty library) if [ ! -e "$calibre_dir"/metadata.db ]; then - cp -a ../conf/metadata.db.empty $calibre_dir/metadata.db + cp -a ../settings/conf/metadata.db.empty $calibre_dir/metadata.db chown $app:$app $calibre_dir/* fi fi