From 8adf27e743ad6ed506cf680d6ec649e95a093e42 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Sun, 3 Sep 2017 11:22:41 +0100
Subject: [PATCH] Tidying

---
 src/freedombone-app-syncthing | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/freedombone-app-syncthing b/src/freedombone-app-syncthing
index 37538e623..9fe808a5c 100755
--- a/src/freedombone-app-syncthing
+++ b/src/freedombone-app-syncthing
@@ -254,7 +254,7 @@ function backup_local_syncthing {
     if [ -d $SYNCTHING_SHARED_DATA ]; then
         function_check backup_directory_to_usb
         backup_directory_to_usb $SYNCTHING_SHARED_DATA syncthingshared
-        backup_directory_to_usb /root/.config/syncthing syncthingconfig
+        backup_directory_to_usb $SYNCTHING_CONFIG_PATH syncthingconfig
     fi
 
     for d in /home/*/ ; do
@@ -294,10 +294,10 @@ function restore_local_syncthing {
         restore_directory_from_usb ${temp_restore_dir}config syncthingconfig
         #cp -r ${temp_restore_dir}config/* /
 
-        if [ ! -d /root/.config/syncthing ]; then
-            mkdir -p /root/.config/syncthing
+        if [ ! -d $SYNCTHING_CONFIG_PATH ]; then
+            mkdir -p $SYNCTHING_CONFIG_PATH
         fi
-        cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
+        cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
 
         if [ ! "$?" = "0" ]; then
             set_user_permissions
@@ -373,10 +373,10 @@ function restore_local_syncthing {
 }
 
 function backup_remote_syncthing {
-    if [ -d /root/.config/syncthing ]; then
+    if [ -d $SYNCTHING_CONFIG_PATH ]; then
         echo $"Backing up syncthing configuration"
         function_check backup_directory_to_friend
-        backup_directory_to_friend /root/.config/syncthing syncthingconfig
+        backup_directory_to_friend $SYNCTHING_CONFIG_PATH syncthingconfig
         echo $"Backup of syncthing configuration complete"
     fi
     if [ -d $SYNCTHING_SHARED_DATA ]; then
@@ -422,10 +422,10 @@ function restore_remote_syncthing {
         function_check restore_directory_from_friend
         restore_directory_from_friend $temp_restore_dir syncthingconfig
         #cp -r $temp_restore_dir/* /
-        if [ ! -d /root/.config/syncthing ]; then
-            mkdir -p /root/.config/syncthing
+        if [ ! -d $SYNCTHING_CONFIG_PATH ]; then
+            mkdir -p $SYNCTHING_CONFIG_PATH
         fi
-        cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
+        cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
         if [ ! "$?" = "0" ]; then
             systemctl start syncthing
             systemctl start cron
-- 
GitLab