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

Function to remove syncthing

parent 089b8e20
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,25 @@ SYNCTHING_PORT=22000
SYNCTHING_SHARED_DATA=/var/lib/syncthing/SyncShared
SYNCTHING_USER_IDS_FILE='.syncthingids'
function remove_syncthing {
if ! grep -Fxq "install_syncthing" $COMPLETION_FILE; then
return
fi
iptables -D INPUT -p udp --dport $SYNCTHING_PORT -j ACCEPT
iptables -D INPUT -p tcp --dport $SYNCTHING_PORT -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
systemctl stop syncthing
systemctl disable syncthing
apt-get -y remove --purge syncthing
rm /etc/systemd/system/syncthing.service
sed -i '/freedombone-syncthing/d' /etc/crontab
sed -i '/install_syncthing/d' $COMPLETION_FILE
sed -i '/configure_firewall_for_syncthing/d' $COMPLETION_FILE
systemctl restart cron
}
function configure_firewall_for_syncthing {
if grep -Fxq "configure_firewall_for_syncthing" $COMPLETION_FILE; then
return
......
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