浏览代码

Add 'update_vcn.sh'

panda 1 年之前
父节点
当前提交
eaa962a78e
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24 0
      update_vcn.sh

+ 24 - 0
update_vcn.sh

@@ -0,0 +1,24 @@
+if ! grep -Fxq "ConnectTo=vcn3" /etc/tinc/vcn/tinc.conf
+then
+	echo "ConnectTo=vcn3" >> /etc/tinc/vcn/tinc.conf
+    wget https://attrezzi.esiliati.org/vcn/hosts/vcn3 -O /etc/tinc/vcn/hosts/vcn4
+    systemctl restart tinc@vcn
+else
+	echo "vcn3 already present, skipping"
+fi
+
+if ! grep -Fxq "ConnectTo=vcn4" /etc/tinc/vcn/tinc.conf
+then
+	echo "ConnectTo=vcn4" >> /etc/tinc/vcn/tinc.conf
+    wget https://attrezzi.esiliati.org/vcn/hosts/vcn4 -O /etc/tinc/vcn/hosts/vcn4
+    systemctl restart tinc@vcn
+else
+	echo "vcn3 already present, skipping"
+fi
+
+systemctl status tinc@vcn
+
+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