Skip to content
Snippets Groups Projects
Commit 8adf27e7 authored by Bob Mottram's avatar Bob Mottram
Browse files

Tidying

parent 387ae1d2
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment