add checks for {ip,ip6}addr in the network config
authorFelix Fietkau <nbd@openwrt.org>
Sun, 14 Jan 2007 22:29:13 +0000 (22:29 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 14 Jan 2007 22:29:13 +0000 (22:29 +0000)
SVN-Revision: 6099

package/base-files/files/lib/network/config.sh

index f3ead6a791d9ab81eb9ce691818d9b97f8f5884d..96890acacd87daf3845683ed503db9dda00d07f8 100755 (executable)
@@ -117,8 +117,8 @@ setup_interface() {
                        config_get gateway "$config" gateway
                        config_get dns "$config" dns
                        
-                       $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask"
-                       $DEBUG ifconfig "$iface" inet6 add "$ip6addr" 
+                       [ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask"
+                       [ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" inet6 add "$ip6addr" 
                        [ -z "$gateway" ] || route add default gw "$gateway"
                        [ -z "$dns" -o -f /tmp/resolv.conf.auto ] || {
                                for ns in $dns; do