summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2006-01-11 16:29:11 +0000
committerFlorian Fainelli <florian@openwrt.org>2006-01-11 16:29:11 +0000
commitb5ff75c13e555e6dee7664a9e901e1ab4990f09e (patch)
treeac6df05718410653f75877051f3150b6bcd50b9e /openwrt/package/base-files/default
parentadcbbc4934ffabd2c25e8002807de0ccbcde4bd3 (diff)
downloadmtk-20170518-b5ff75c13e555e6dee7664a9e901e1ab4990f09e.zip
mtk-20170518-b5ff75c13e555e6dee7664a9e901e1ab4990f09e.tar.gz
mtk-20170518-b5ff75c13e555e6dee7664a9e901e1ab4990f09e.tar.bz2
Do not delete default route if the router is the same, fixes #138
SVN-Revision: 2913
Diffstat (limited to 'openwrt/package/base-files/default')
-rwxr-xr-xopenwrt/package/base-files/default/usr/share/udhcpc/default.script14
1 files changed, 8 insertions, 6 deletions
diff --git a/openwrt/package/base-files/default/usr/share/udhcpc/default.script b/openwrt/package/base-files/default/usr/share/udhcpc/default.script
index 9fac628..304be11 100755
--- a/openwrt/package/base-files/default/usr/share/udhcpc/default.script
+++ b/openwrt/package/base-files/default/usr/share/udhcpc/default.script
@@ -26,12 +26,14 @@ case "$1" in
broadcast ${broadcast:-+}
if [ -n "$router" ] ; then
- echo "deleting routers"
- while route del default gw 0.0.0.0 dev $interface ; do :; done
-
- for i in $router ; do
- route add default gw $i dev $interface
- done
+
+ if [ "$router" != "$(route -n | grep '^0.0.0.0' | grep vlan1 | awk '{ print $2 }')" ] ; then
+ echo "deleting routers"
+ while route del default gw 0.0.0.0 dev $interface ; do :; done
+ for i in $router ; do
+ route add default gw $i dev $interface
+ done
+ fi
fi
echo -n > $RESOLV_CONF