Index: iptables/setnapt.sh
===================================================================
--- iptables/setnapt.sh	(revision c1094188ede7a1445e590417ab77e4020724332c)
+++ iptables/setnapt.sh	(revision 84d82932ad5d20fba956d85c903705ff2f2c6a7a)
@@ -31,5 +31,5 @@
 
 if [ -z "${GATEWAYS}" ]; then
-    GATEWAYS=`/sbin/ip route show table main | grep -w default | cut -d ' ' -f 5`
+    GATEWAYS=`/sbin/ip route show table main | grep -w default | tr -s ' ' | cut -d ' ' -f 5`
 fi
 
@@ -40,5 +40,5 @@
     fi
     
-    IPADDR=`/sbin/ip addr show dev ${GW} | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1`
+    IPADDR=`/sbin/ip addr show dev ${GW} | grep -w inet | tr -s ' ' | cut -d ' ' -f 3 | cut -d / -f 1`
     if [ -z "${IPADDR}" ]; then
         # device doesn't seem to have an IP address
