Bob Mottram 7 年前
父节点
当前提交
8adf27e743
共有 1 个文件被更改,包括 9 次插入9 次删除
  1. 9
    9
      src/freedombone-app-syncthing

+ 9
- 9
src/freedombone-app-syncthing 查看文件

@@ -254,7 +254,7 @@ function backup_local_syncthing {
254 254
     if [ -d $SYNCTHING_SHARED_DATA ]; then
255 255
         function_check backup_directory_to_usb
256 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 258
     fi
259 259
 
260 260
     for d in /home/*/ ; do
@@ -294,10 +294,10 @@ function restore_local_syncthing {
294 294
         restore_directory_from_usb ${temp_restore_dir}config syncthingconfig
295 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 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 302
         if [ ! "$?" = "0" ]; then
303 303
             set_user_permissions
@@ -373,10 +373,10 @@ function restore_local_syncthing {
373 373
 }
374 374
 
375 375
 function backup_remote_syncthing {
376
-    if [ -d /root/.config/syncthing ]; then
376
+    if [ -d $SYNCTHING_CONFIG_PATH ]; then
377 377
         echo $"Backing up syncthing configuration"
378 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 380
         echo $"Backup of syncthing configuration complete"
381 381
     fi
382 382
     if [ -d $SYNCTHING_SHARED_DATA ]; then
@@ -422,10 +422,10 @@ function restore_remote_syncthing {
422 422
         function_check restore_directory_from_friend
423 423
         restore_directory_from_friend $temp_restore_dir syncthingconfig
424 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 427
         fi
428
-        cp -r ${temp_restore_dir}config/* /root/.config/syncthing/
428
+        cp -r ${temp_restore_dir}config/* $SYNCTHING_CONFIG_PATH/
429 429
         if [ ! "$?" = "0" ]; then
430 430
             systemctl start syncthing
431 431
             systemctl start cron