diff options
Diffstat (limited to 'Push')
-rwxr-xr-x | Push | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -13,7 +13,7 @@ end def getFilesMD5(host, ssh_hostname) cmd = ssh_hostname ? - "ssh root@#{ssh_hostname} /bin/ls -1 /etc/openvpn" : + "ssh -4 root@#{ssh_hostname} /bin/ls -1 /etc/openvpn" : "ls -1 #{$NAMESPACE}-#{host}" puts "| " + cmd f = IO.popen( cmd, aModeString="r" ); @@ -23,7 +23,7 @@ def getFilesMD5(host, ssh_hostname) md5 = {} if (files.length > 0) cmd = ssh_hostname ? - "ssh root@#{ssh_hostname} 'cd /etc/openvpn && md5sum " + files.join(' ') + "'" : + "ssh -4 root@#{ssh_hostname} 'cd /etc/openvpn && md5sum " + files.join(' ') + "'" : "cd #{$NAMESPACE}-#{host} && md5sum " + files.join(' ') puts "| " + cmd f = IO.popen( cmd, aModeString="r" ); @@ -105,7 +105,7 @@ hosts.each{ |hostname| } dir = "#{$NAMESPACE}-#{hostname}/" - sys("scp "+copy.collect{|f| dir+f }.join(' ')+" root@#{ssh_hostname}:/etc/openvpn/") if copy.size > 0 + sys("scp -4 "+copy.collect{|f| dir+f }.join(' ')+" root@#{ssh_hostname}:/etc/openvpn/") if copy.size > 0 commands = [] commands << "sh ./#{do_iptables} &&\n" if do_iptables commands << "sh ./#{do_ip6tables} &&\n" if do_ip6tables @@ -115,13 +115,13 @@ hosts.each{ |hostname| command = "cd /etc/openvpn && \n"; command << commands.join('') command << "echo 'all done'" - sys("ssh root@#{ssh_hostname} '#{command}'") if commands.size > 0 + sys("ssh -4 root@#{ssh_hostname} '#{command}'") if commands.size > 0 if (do_quagga) - sys("ssh root@#{ssh_hostname} 'cp -a /etc/openvpn/#{$NAMESPACE}.quagga.bgpd /etc/quagga/bgpd.conf && - cp -a /etc/openvpn/#{$NAMESPACE}.quagga.zebra /etc/quagga/zebra.conf && - cp -a /etc/openvpn/#{$NAMESPACE}.quagga.daemons /etc/quagga/daemons && - chmod 640 /etc/quagga/bgpd.conf /etc/quagga/zebra.conf && - chgrp quagga /etc/quagga/bgpd.conf /etc/quagga/zebra.conf && - /etc/init.d/quagga restart'") + sys("ssh -4 root@#{ssh_hostname} 'cp -a /etc/openvpn/#{$NAMESPACE}.quagga.bgpd /etc/quagga/bgpd.conf && + cp -a /etc/openvpn/#{$NAMESPACE}.quagga.zebra /etc/quagga/zebra.conf && + cp -a /etc/openvpn/#{$NAMESPACE}.quagga.daemons /etc/quagga/daemons && + chmod 640 /etc/quagga/bgpd.conf /etc/quagga/zebra.conf && + chgrp quagga /etc/quagga/bgpd.conf /etc/quagga/zebra.conf && + /etc/init.d/quagga restart'") end } |