Skip to content
Snippets Groups Projects
Commit 0c3d0f3c authored by Bob Mottram's avatar Bob Mottram
Browse files

Tidying syncthing

parent 637f18d5
No related branches found
No related tags found
No related merge requests found
......@@ -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 -
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment