Bob Mottram 7 years ago
parent
commit
aaf2f67f0a
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      src/freedombone-app-syncthing

+ 10
- 3
src/freedombone-app-syncthing View File

13
 # License
13
 # License
14
 # =======
14
 # =======
15
 #
15
 #
16
-# Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net>
16
+# Copyright (C) 2014-2017 Bob Mottram <bob@freedombone.net>
17
 #
17
 #
18
 # This program is free software: you can redistribute it and/or modify
18
 # This program is free software: you can redistribute it and/or modify
19
 # it under the terms of the GNU Affero General Public License as published by
19
 # it under the terms of the GNU Affero General Public License as published by
484
     mark_completed $FUNCNAME
484
     mark_completed $FUNCNAME
485
 }
485
 }
486
 
486
 
487
-function install_syncthing {
488
-    apt-get -yq install curl
487
+function install_syncthing_repo {
488
+    if [ -f /etc/apt/sources.list.d/syncthing.list ]; then
489
+        return
490
+    fi
489
 
491
 
492
+    apt-get -yq install curl
490
     curl -s https://syncthing.net/release-key.txt | apt-key add -
493
     curl -s https://syncthing.net/release-key.txt | apt-key add -
491
     echo "deb http://apt.syncthing.net/ syncthing release" | tee /etc/apt/sources.list.d/syncthing.list
494
     echo "deb http://apt.syncthing.net/ syncthing release" | tee /etc/apt/sources.list.d/syncthing.list
492
     apt-get update
495
     apt-get update
496
+}
497
+
498
+function install_syncthing {
499
+    install_syncthing_repo
493
     apt-get -yq install syncthing
500
     apt-get -yq install syncthing
494
 
501
 
495
     # This probably does need to run as root so that it can access the Sync directories
502
     # This probably does need to run as root so that it can access the Sync directories