prevent ldconfig use in autoconf based packages
[openwrt/svn-archive/archive.git] / openwrt / package / base-files / default / etc / functions.sh
index ed44b76750160c289225f327c2876fb4c03d0b3c..57f2734c1c4c047312e7383b2a6e534840d91591 100755 (executable)
@@ -17,6 +17,7 @@ if_valid () (
 
       vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
       debug "# vlan$i => $vif"
+         [ -n "$vif" ] || vif=$(ifconfig -a | awk '/^eth'${hw##et}'/ {print $1; exit}' IGNORECASE=1)
 
       $DEBUG ifconfig $vif up
       $DEBUG vconfig add $vif $i 2>&-
@@ -55,10 +56,11 @@ do_ifup() {
                [ -n "$static_route" ] && {
                        for route in $static_route; do {
                        eval "set $(echo $route | sed 's/:/ /g')"
-                               if [ "$2" = "255.255.255.255" ]; then
+                               if [ "$2" = "0.0.0.0" ]; then
                                        opt="-host"
                                fi
                                $DEBUG route add ${opt:-"-net"} $1 netmask $2 gw $3 metric $4 
+                               unset opt
                        } done
                }