Do not suppress routes if the router received on renew is the same (#138)
authorFlorian Fainelli <florian@openwrt.org>
Sun, 13 May 2007 21:58:08 +0000 (21:58 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 13 May 2007 21:58:08 +0000 (21:58 +0000)
SVN-Revision: 7215

package/base-files/files/usr/share/udhcpc/default.script

index c7239535660df4b91603741c54812a29e6cfe6ca..f2099204e36a342bbb44c861695a5f70d3dbc0d0 100755 (executable)
@@ -28,7 +28,7 @@ case "$1" in
                netmask ${subnet:-255.255.255.0} \
                broadcast ${broadcast:-+}
 
-               if [ -n "$router" ] ; then
+               if [ "$router" != "$(route -n | grep '^0.0.0.0' | grep $interface | awk '{ print $2 }')" ] ; then
                        echo "deleting routers"
                        while route del default gw 0.0.0.0 dev $interface >&- 2>&- ; do :; done