update_vcn_insecure.sh 847 B

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