Tidying syncthing

This commit is contained in:
Bob Mottram 2016-10-13 12:32:45 +01:00
parent 637f18d5a5
commit 0c3d0f3c5b
1 changed files with 0 additions and 34 deletions

View File

@ -489,41 +489,7 @@ function configure_firewall_for_syncthing {
echo 'configure_firewall_for_syncthing' >> $COMPLETION_FILE
}
function mesh_install_syncthing {
chroot "$rootdir" wget -q https://syncthing.net/release-key.txt -O- | apt-key add -
echo "deb http://apt.syncthing.net/ syncthing release" | tee $rootdir/etc/apt/sources.list.d/syncthing.list
chroot "$rootdir" apt-get update
chroot "$rootdir" apt-get -y --force-yes install syncthing
# This probably does need to run as root so that it can access the Sync directories
# in each user's home directory
echo '[Unit]' > $rootdir/etc/systemd/system/syncthing.service
echo 'Description=Syncthing - Open Source Continuous File Synchronization' >> $rootdir/etc/systemd/system/syncthing.service
echo 'Documentation=man:syncthing(1)' >> $rootdir/etc/systemd/system/syncthing.service
echo 'After=network.target' >> $rootdir/etc/systemd/system/syncthing.service
echo 'Wants=syncthing-inotify@.service' >> $rootdir/etc/systemd/system/syncthing.service
echo '' >> $rootdir/etc/systemd/system/syncthing.service
echo '[Service]' >> $rootdir/etc/systemd/system/syncthing.service
echo 'User=root' >> $rootdir/etc/systemd/system/syncthing.service
echo 'ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0' >> $rootdir/etc/systemd/system/syncthing.service
echo 'Restart=on-failure' >> $rootdir/etc/systemd/system/syncthing.service
echo 'SuccessExitStatus=3 4' >> $rootdir/etc/systemd/system/syncthing.service
echo 'RestartForceExitStatus=3 4' >> $rootdir/etc/systemd/system/syncthing.service
echo '' >> $rootdir/etc/systemd/system/syncthing.service
echo '[Install]' >> $rootdir/etc/systemd/system/syncthing.service
echo 'WantedBy=multi-user.target' >> $rootdir/etc/systemd/system/syncthing.service
chroot "$rootdir" systemctl enable syncthing
echo 'mesh_install_syncthing'
}
function install_syncthing {
if [ $INSTALLING_MESH ]; then
mesh_install_syncthing
return
fi
apt-get -y install curl
curl -s https://syncthing.net/release-key.txt | apt-key add -