update_vcn.sh 829 B

123456789101112131415161718192021222324
  1. if ! grep -Fxq "ConnectTo=vcn3" /etc/tinc/vcn/tinc.conf
  2. then
  3. echo "ConnectTo=vcn3" >> /etc/tinc/vcn/tinc.conf
  4. wget https://attrezzi.esiliati.org/vcn/hosts/vcn3 -O /etc/tinc/vcn/hosts/vcn4
  5. systemctl restart tinc@vcn
  6. else
  7. echo "vcn3 already present, skipping"
  8. fi
  9. if ! grep -Fxq "ConnectTo=vcn4" /etc/tinc/vcn/tinc.conf
  10. then
  11. echo "ConnectTo=vcn4" >> /etc/tinc/vcn/tinc.conf
  12. wget https://attrezzi.esiliati.org/vcn/hosts/vcn4 -O /etc/tinc/vcn/hosts/vcn4
  13. systemctl restart tinc@vcn
  14. else
  15. echo "vcn3 already present, skipping"
  16. fi
  17. systemctl status tinc@vcn
  18. sed -i '/ExecStart/c\ExecStart=/usr/sbin/tincd -n %i -D --logfile' /lib/systemd/system/tinc@.service
  19. sed -i '/ExecReload/c\ExecReload=/usr/sbin/tincd -n %i -kHUP --logfile' /lib/systemd/system/tinc@.service
  20. systemctl daemon-reload
  21. systemctl restart tinc@vcn