]> code.ossystems Code Review - openembedded-core.git/commitdiff
Use /sbin/iptables if which iptables fails.
authorJoshua Lock <josh@openedhand.com>
Thu, 26 Jun 2008 14:27:31 +0000 (14:27 +0000)
committerJoshua Lock <josh@openedhand.com>
Thu, 26 Jun 2008 14:27:31 +0000 (14:27 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4733 311d38ba-8fff-0310-9ca6-ca027cbcb966

scripts/poky-qemu-ifup

index d68e64c2812f789a73f57039e1d1845fe230aaf0..cb1891e271633bf78c68cb5980bc8e46244b6c4a 100755 (executable)
@@ -27,6 +27,11 @@ fi
 $IFCONFIG tap0 192.168.7.1
 
 # setup NAT for tap0 interface to have internet access in QEMU
-iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
+IPTABLES=`which iptables`
+if [ "x$IPTABLES" = "x" ]; then
+    IPTABLES=/sbin/iptables
+fi
+
+$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
 echo 1 > /proc/sys/net/ipv4/ip_forward
-iptables -P FORWARD ACCEPT
+$IPTABLES -P FORWARD ACCEPT