Restore of syncthing users

This commit is contained in:
Bob Mottram 2018-01-20 10:34:08 +00:00
parent 7ab85b55d2
commit b72da11f6c
1 changed files with 12 additions and 2 deletions

View File

@ -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