tag 472882 patch
thanks

Attached is a patch fixing the bashisms.

Cheers,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
diff -urN knetfilter-3.5.0.orig/src/scripts/kiptables-save knetfilter-3.5.0/src/scripts/kiptables-save
--- knetfilter-3.5.0.orig/src/scripts/kiptables-save	2002-05-12 17:06:05.000000000 -0500
+++ knetfilter-3.5.0/src/scripts/kiptables-save	2008-04-06 13:18:44.000000000 -0500
@@ -49,36 +49,36 @@
 	
 	export input="`iptables -L INPUT -n | grep -v target | grep -v Chain  | awk '{print gensub (/spt:/, "--sport ", 1)}'|  awk '{print gensub (/spts:/, "--sport ", 1)}' |  awk '{print gensub (/dpt:/, "--dport ", 1)}' | awk '{print gensub (/dpts:/, "--dport ", 1)}' | awk '{print gensub (/type/, "--icmp-type ", 1)}' | awk '{print gensub (/reject-with icmp-port-unreachable/, " " ,1)}' | awk '{print gensub (/flags:0x0216\/0x022/, "--syn " ,1)}' | awk '{print gensub(/state/, "-m state --state", 1)}' | awk '{print gensub(/MARK match/, "-m mark --mark", 1)}' | awk '{print gensub(/tcp/, " ", 2)}' | awk '{print gensub(/udp/, " ", 2)}' | awk '{print gensub(/icmp/, " ", 2)}' | awk '{print "iptables -A INPUT", "-p", $2, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, "-s", $4, "-d", $5, "-j", $1, ";"}'`" 
 	
-	echo -e $input >> /etc/iptables.cfg
+	printf "$input\n" >> /etc/iptables.cfg
 	
 	export forward="`iptables -L FORWARD -n | grep -v target | grep -v Chain  | awk '{print gensub (/spt:/, "--sport ", 1)}'|  awk '{print gensub (/spts:/, "--sport ", 1)}' |  awk '{print gensub (/dpt:/, "--dport ", 1)}' | awk '{print gensub (/dpts:/, "--dport ", 1)}' | awk '{print gensub (/type/, "--icmp-type ", 1)}' | awk '{print gensub (/reject-with icmp-port-unreachable/, " " ,1)}' | awk '{print gensub (/flags:0x0216\/0x022/, "--syn " ,1)}' | awk '{print gensub(/state/, "-m state --state", 1)}' | awk '{print gensub(/MARK match/, "-m mark --mark", 1)}' | awk '{print gensub(/tcp/, " ", 2)}' | awk '{print gensub(/udp/, " ", 2)}' | awk '{print gensub(/icmp/, " ", 2)}' | awk '{print "iptables -A FORWARD", "-p", $2, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, "-s", $4, "-d", $5, "-j", $1, ";"}'`" 
 	
-	echo -e $forward >> /etc/iptables.cfg
+	printf "$forward\n" >> /etc/iptables.cfg
 	
 	export output="`iptables -L OUTPUT -n | grep -v target | grep -v Chain  | awk '{print gensub (/spt:/, "--sport ", 1)}'|  awk '{print gensub (/spts:/, "--sport ", 1)}' |  awk '{print gensub (/dpt:/, "--dport ", 1)}' | awk '{print gensub (/dpts:/, "--dport ", 1)}' |awk '{print gensub (/type/, "--icmp-type ", 1)}' | awk '{print gensub (/reject-with icmp-port-unreachable/, " " ,1)}' | awk '{print gensub (/flags:0x0216\/0x022/, "--syn " ,1)}' | awk '{print gensub(/state/, "-m state --state", 1)}' | awk '{print gensub(/MARK match/, "-m mark --mark", 1)}' | awk '{print gensub(/tcp/, " ", 2)}' | awk '{print gensub(/udp/, " ", 2)}' | awk '{print gensub(/icmp/, " ", 2)}' | awk '{print "iptables -A OUTPUT", "-p", $2, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, "-s", $4, "-d", $5, "-j", $1, ";"}'`" 
 	
-	echo -e $output >> /etc/iptables.cfg
+	printf "$output\n" >> /etc/iptables.cfg
 	
 	export chain="`iptables -L -n -v | grep Chain | awk '{print "iptables -P", $2, $4, ";"}'`" 
 	
-	echo -e $chain >> /etc/iptables.cfg
+	printf "$chain\n" >> /etc/iptables.cfg
 	
 # NAT AND MASQUERADE
 	
 	export nat_prerouting="`iptables -t  nat -L PREROUTING -n |  grep -v target | grep -v Chain  | awk '{print gensub(/spt:/, "--source-port ", 1)}' | awk '{print gensub(/spts:/, "--source-port ", 1)}' | awk '{print gensub(/dpt:/, "--destination-port ", 1)}' | awk '{print gensub(/dpts:/, "--destination-port ", 1)}' | awk '{print gensub(/redir ports/, "--to ", 1)}' | awk '{print gensub(/to:/, "--to ", 1)}' | awk '{print gensub(/tcp/, " ", 2)}' |  awk '{print gensub(/udp/, " ", 2)}' |  awk '{print gensub(/icmp/, " ", 2)}' | awk '{print "iptables -t nat -A PREROUTING", "-p", $2,  "-j", $1, "-s", $4, "-d", $5, $6, $7, $8, $9, $10, $11, $12, ";"}'`"
 	
-	echo -e $nat_prerouting >> /etc/iptables.cfg
+	printf "$nat_prerouting\n" >> /etc/iptables.cfg
 	
 	export nat_postrouting="`iptables -t  nat -L POSTROUTING -n | grep -v target | grep -v Chain  | awk '{print gensub(/spt:/, "--source-port ", 1)}' | awk '{print gensub(/spts:/, "--source-port ", 1)}' | awk '{print gensub(/dpt:/, "--destination-port ", 1)}' | awk '{print gensub(/dpts:/, "--destination-port ", 1)}' | awk '{print gensub(/redir ports/, "--to ", 1)}' | awk '{print gensub(/type/, "--icmp-type ", 1)}' | awk '{print gensub(/to:/, "--to ", 1)}' | awk '{print gensub(/tcp/, " ", 2)}' |  awk '{print gensub(/udp/, " ", 2)}' |  awk '{print gensub(/icmp/, " ", 2)}' | awk '{print "iptables -t nat -A POSTROUTING", "-p", $2,  "-j", $1, "-s", $4, "-d", $5, $6, $7, $8, $9, $10, $11, $12, ";"}'`"
 	
-	echo -e $nat_postrouting >> /etc/iptables.cfg
+	printf "$nat_postrouting\n" >> /etc/iptables.cfg
 	
 	export nat_output="`iptables -t  nat -L OUTPUT -n |  grep -v target | grep -v Chain  | awk '{print gensub(/spt:/, "--source-port ", 1)}' | awk '{print gensub(/spts:/, "--source-port ", 1)}' | awk '{print gensub(/dpt:/, "--destination-port ", 1)}' | awk '{print gensub(/dpts:/, "--destination-port ", 1)}' | awk '{print gensub(/redir ports/, "--to ", 1)}' | awk '{print gensub(/to:/, "--to ", 1)}' | awk '{print gensub(/tcp/, " ", 2)}' |  awk '{print gensub(/udp/, " ", 2)}' |  awk '{print gensub(/icmp/, " ", 2)}' | awk '{print "iptables -t nat -A OUTPUT", "-p", $2,  "-j", $1, "-s", $4, "-d", $5, $6, $7, $8, $9, $10, $11, $12, ";"}'`"
 	
-	echo -e $nat_output >> /etc/iptables.cfg
+	printf "$nat_output\n" >> /etc/iptables.cfg
 	
 	export nat_chain="`iptables -t nat -L -n -v | grep Chain | awk '{print "iptables -t nat -P", $2, $4, ";"}'`" 
-	echo -e $nat_chain >> /etc/iptables.cfg
+	printf "$nat_chain\n" >> /etc/iptables.cfg
 	
 # MANGLE
 	
@@ -91,7 +91,7 @@
 	echo $mangle_output >> /etc/iptables.cfg
 	
 	export mangle_chain="`iptables -t mangle -L -n -v | grep Chain | awk '{print "iptables -t mangle -P", $2, $4, ";"}'`"
-	echo -e $mangle_chain >> /etc/iptables.cfg 
+	printf "$mangle_chain\n" >> /etc/iptables.cfg 
 	
 	chmod 755 /etc/iptables.cfg	
 	;;

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to