From 4883e438dfaf08f6c79e0adfe0fdd3260b6d2969 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 20 May 2006 23:59:10 +0000 Subject: Add original sa-bogofilter git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@95 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- Push | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Push b/Push index 1820a39..b389f97 100755 --- a/Push +++ b/Push @@ -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 } -- cgit v1.2.3