From aaf2f67f0a841cb60e8b7edeaf1dbac81d67dda8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 2 Jul 2017 17:48:31 +0100 Subject: [PATCH] Tidying --- src/freedombone-app-syncthing | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-syncthing b/src/freedombone-app-syncthing index 7d06472f..befe878b 100755 --- a/src/freedombone-app-syncthing +++ b/src/freedombone-app-syncthing @@ -13,7 +13,7 @@ # License # ======= # -# Copyright (C) 2014-2016 Bob Mottram +# Copyright (C) 2014-2017 Bob Mottram # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -484,12 +484,19 @@ function configure_firewall_for_syncthing { mark_completed $FUNCNAME } -function install_syncthing { - apt-get -yq install curl +function install_syncthing_repo { + if [ -f /etc/apt/sources.list.d/syncthing.list ]; then + return + fi + apt-get -yq install curl curl -s https://syncthing.net/release-key.txt | apt-key add - echo "deb http://apt.syncthing.net/ syncthing release" | tee /etc/apt/sources.list.d/syncthing.list apt-get update +} + +function install_syncthing { + install_syncthing_repo apt-get -yq install syncthing # This probably does need to run as root so that it can access the Sync directories