From b72da11f6c080dfa844d9b506ad5aa3453c5c7a0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 20 Jan 2018 10:34:08 +0000 Subject: [PATCH] Restore of syncthing users --- src/freedombone-app-syncthing | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-syncthing b/src/freedombone-app-syncthing index f1947ce6..509fae0f 100755 --- a/src/freedombone-app-syncthing +++ b/src/freedombone-app-syncthing @@ -336,7 +336,12 @@ function restore_local_syncthing { if [ ! -d /home/$USERNAME/Sync ]; then mkdir /home/$USERNAME/Sync fi - cp -r ${temp_restore_dir}/* /home/$USERNAME/Sync/ + if [ -d /root/Sync ]; then + cp -r /root/Sync/* /home/$USERNAME/Sync/ + rm -rf /root/Sync + else + cp -r ${temp_restore_dir}/* /home/$USERNAME/Sync/ + fi fi if [ ! "$?" = "0" ]; then rm -rf ${temp_restore_dir} @@ -458,7 +463,12 @@ function restore_remote_syncthing { if [ ! -d /home/$USERNAME/Sync ]; then mkdir /home/$USERNAME/Sync fi - cp -r $temp_restore_dir/* /home/$USERNAME/Sync/ + if [ -d /root/Sync ]; then + cp -r /root/Sync/* /home/$USERNAME/Sync/ + rm -rf /root/Sync + else + cp -r ${temp_restore_dir}/* /home/$USERNAME/Sync/ + fi fi if [ ! "$?" = "0" ]; then rm -rf $temp_restore_dir