1234567891011121314151617181920212223242526 |
- #!/usr/bin/env bash
- if ! grep -Fxq "ConnectTo=vcn3" /etc/tinc/vcn/tinc.conf
- then
- wget --no-check-certificate https://attrezzi.esiliati.org/vcn/hosts/vcn3 -O /etc/tinc/vcn/hosts/vcn3
- echo "ConnectTo=vcn3" >> /etc/tinc/vcn/tinc.conf
- else
- echo "vcn3 already present, skipping"
- fi
- if ! grep -Fxq "ConnectTo=vcn4" /etc/tinc/vcn/tinc.conf
- then
- wget --no-check-certificate https://attrezzi.esiliati.org/vcn/hosts/vcn4 -O /etc/tinc/vcn/hosts/vcn4
- echo "ConnectTo=vcn4" >> /etc/tinc/vcn/tinc.conf
- else
- echo "vcn4 already present, skipping"
- fi
- sed -i '/ExecStart/c\ExecStart=/usr/sbin/tincd -n %i -D --logfile' /lib/systemd/system/tinc@.service
- sed -i '/ExecReload/c\ExecReload=/usr/sbin/tincd -n %i -kHUP --logfile' /lib/systemd/system/tinc@.service
- systemctl daemon-reload
- systemctl restart tinc@vcn
- systemctl status tinc@vcn
|