Bob Mottram il y a 7 ans
Parent
révision
8adf27e743
1 fichiers modifiés avec 9 ajouts et 9 suppressions
  1. 9
    9
      src/freedombone-app-syncthing

+ 9
- 9
src/freedombone-app-syncthing Voir le fichier

254
     if [ -d $SYNCTHING_SHARED_DATA ]; then
254
     if [ -d $SYNCTHING_SHARED_DATA ]; then
255
         function_check backup_directory_to_usb
255
         function_check backup_directory_to_usb
256
         backup_directory_to_usb $SYNCTHING_SHARED_DATA syncthingshared
256
         backup_directory_to_usb $SYNCTHING_SHARED_DATA syncthingshared
257
-        backup_directory_to_usb /root/.config/syncthing syncthingconfig
257
+        backup_directory_to_usb $SYNCTHING_CONFIG_PATH syncthingconfig
258
     fi
258
     fi
259
 
259
 
260
     for d in /home/*/ ; do
260
     for d in /home/*/ ; do
294
         restore_directory_from_usb ${temp_restore_dir}config syncthingconfig
294
         restore_directory_from_usb ${temp_restore_dir}config syncthingconfig
295
         #cp -r ${temp_restore_dir}config/* /
295
         #cp -r ${temp_restore_dir}config/* /
296
 
296
 
297
-        if [ ! -d /root/.config/syncthing ]; then
298
-            mkdir -p /root/.config/syncthing
297
+        if [ ! -d $SYNCTHING_CONFIG_PATH ]; then
298
+            mkdir -p $SYNCTHING_CONFIG_PATH
299
         fi
299
         fi
300
-        cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
300
+        cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
301
 
301
 
302
         if [ ! "$?" = "0" ]; then
302
         if [ ! "$?" = "0" ]; then
303
             set_user_permissions
303
             set_user_permissions
373
 }
373
 }
374
 
374
 
375
 function backup_remote_syncthing {
375
 function backup_remote_syncthing {
376
-    if [ -d /root/.config/syncthing ]; then
376
+    if [ -d $SYNCTHING_CONFIG_PATH ]; then
377
         echo $"Backing up syncthing configuration"
377
         echo $"Backing up syncthing configuration"
378
         function_check backup_directory_to_friend
378
         function_check backup_directory_to_friend
379
-        backup_directory_to_friend /root/.config/syncthing syncthingconfig
379
+        backup_directory_to_friend $SYNCTHING_CONFIG_PATH syncthingconfig
380
         echo $"Backup of syncthing configuration complete"
380
         echo $"Backup of syncthing configuration complete"
381
     fi
381
     fi
382
     if [ -d $SYNCTHING_SHARED_DATA ]; then
382
     if [ -d $SYNCTHING_SHARED_DATA ]; then
422
         function_check restore_directory_from_friend
422
         function_check restore_directory_from_friend
423
         restore_directory_from_friend $temp_restore_dir syncthingconfig
423
         restore_directory_from_friend $temp_restore_dir syncthingconfig
424
         #cp -r $temp_restore_dir/* /
424
         #cp -r $temp_restore_dir/* /
425
-        if [ ! -d /root/.config/syncthing ]; then
426
-            mkdir -p /root/.config/syncthing
425
+        if [ ! -d $SYNCTHING_CONFIG_PATH ]; then
426
+            mkdir -p $SYNCTHING_CONFIG_PATH
427
         fi
427
         fi
428
-        cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
428
+        cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
429
         if [ ! "$?" = "0" ]; then
429
         if [ ! "$?" = "0" ]; then
430
             systemctl start syncthing
430
             systemctl start syncthing
431
             systemctl start cron
431
             systemctl start cron