summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoshua Lock <josh@openedhand.com>2008-06-26 14:27:31 +0000
committerJoshua Lock <josh@openedhand.com>2008-06-26 14:27:31 +0000
commit932d0b00dac96893d78218bbd00b4a48e4183e3d (patch)
treeee7caa5c3f10053e6261c36181938dec53e7c4a2 /scripts
parent41d987a5bed0a0ac8c9d56b45d51ac8cd071fd43 (diff)
downloadopenembedded-core-932d0b00dac96893d78218bbd00b4a48e4183e3d.tar.gz
openembedded-core-932d0b00dac96893d78218bbd00b4a48e4183e3d.tar.bz2
openembedded-core-932d0b00dac96893d78218bbd00b4a48e4183e3d.tar.xz
openembedded-core-932d0b00dac96893d78218bbd00b4a48e4183e3d.zip
Use /sbin/iptables if which iptables fails.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4733 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/poky-qemu-ifup9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/poky-qemu-ifup b/scripts/poky-qemu-ifup
index d68e64c28..cb1891e27 100755
--- a/scripts/poky-qemu-ifup
+++ b/scripts/poky-qemu-ifup
@@ -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