summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-05-01 17:48:15 +0300
committerPaul Buetow <paul@buetow.org>2025-05-01 17:48:15 +0300
commit404e6a3eac35ae4469a404bbcf4d38eb11f5dc0e (patch)
treece8b8835704a243d4c2a18f22ee1af8b562b6359
parent3202136ef43723262c5eda69cc42e5d3861f0caa (diff)
initial mesh works
-rw-r--r--README.md3
-rw-r--r--wireguardmeshgenerator.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/README.md b/README.md
index 2932887..ca134b8 100644
--- a/README.md
+++ b/README.md
@@ -42,13 +42,12 @@ END
[root@r0 ~] dnf update -y
[root@r0 ~] reboot
-[root@r0 ~] firewall-cmd --add-port=51820/udp --permanent
-[root@r0 ~] firewall-cmd --reload
[root@r0 ~] dnf install wireguard-tools
[root@r0 ~] mkdir -p /etc/wireguard
[root@r0 ~] touch /etc/wireguard/wg0.conf
[root@r0 ~] systemctl enable wg-quick@wg0.service
[root@r0 ~] systemctl start wg-quick@wg0.service
+[root@r0 ~] systemctl disable firewalld
[root@r0 ~] cat <<END >>/etc/hosts
192.168.1.130 f0 f0.lan f0.lan.buetow.org
diff --git a/wireguardmeshgenerator.rb b/wireguardmeshgenerator.rb
index c7badd4..aee7d81 100644
--- a/wireguardmeshgenerator.rb
+++ b/wireguardmeshgenerator.rb
@@ -153,7 +153,9 @@ InstallConfig = Struct.new(:myself, :hosts) do
#!/bin/sh
set -x
#{cmd}
+ rm $0
SH
+ File.delete('cmd.sh') if File.exist?('cmd.sh')
Net::SSH.start(@myself, @ssh_user) do |ssh|
output = ssh.exec!('sh cmd.sh')
raise output unless output.exitstatus.zero?