summaryrefslogtreecommitdiff
path: root/wireguardmeshgenerator.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-05-06 12:35:33 +0300
committerPaul Buetow <paul@buetow.org>2025-05-06 12:35:33 +0300
commit9a8d301151249eaf23cc20aa6e913d0cf8dc45c2 (patch)
treed67f7137f37f9b34372b8df04e302f09dfd672e8 /wireguardmeshgenerator.rb
parent2ad4a74bd0ba2cdc76e0d54e34d195a7675430e1 (diff)
fix
Diffstat (limited to 'wireguardmeshgenerator.rb')
-rw-r--r--wireguardmeshgenerator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/wireguardmeshgenerator.rb b/wireguardmeshgenerator.rb
index dfc4e21..520d615 100644
--- a/wireguardmeshgenerator.rb
+++ b/wireguardmeshgenerator.rb
@@ -220,13 +220,13 @@ InstallConfig = Struct.new(:myself, :hosts) do
# Executes a shell command on the remote host using SSH.
def ssh(cmd)
+ File.delete('cmd.sh') if File.exist?('cmd.sh')
File.write('cmd.sh', <<~SH) and scp('cmd.sh')
#!/bin/sh
set -x
#{cmd}
rm $0
SH
- File.delete('cmd.sh') if File.exist?('cmd.sh')
Net::SSH.start(@fqdn, @ssh_user) do |ssh|
output = ssh.exec!('sh cmd.sh')
raise output unless output.exitstatus.zero?