more fixes
authorFelix Fietkau <nbd@openwrt.org>
Fri, 15 Jun 2007 16:07:09 +0000 (16:07 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 15 Jun 2007 16:07:09 +0000 (16:07 +0000)
SVN-Revision: 7639

package/base-files/files/bin/uci
package/base-files/files/lib/network/config.sh
package/base-files/files/sbin/hotplug-call
package/base-files/files/sbin/ifdown
package/base-files/files/sbin/wifi

index 90098f014fa782c88745f2cd0fcaac2f5ab61ead..f89fe82b7eb4268687a3430c3a6f0d2a92b86e60 100755 (executable)
@@ -106,7 +106,7 @@ do_show() {
                SECTION=""
        
                config_cb() {
-                       if [ -z "$CONFIG" -o "$CONFIG" = "$2" ]; then
+                       if [ -z "$CONFIG" -o ."$CONFIG" = ."$2" ]; then
                                append SECTION "$2"
                                option_cb() {
                                        append "${CONFIG_SECTION}_VARS" "$1"
index c5334cbd5d3e814699fd293679bc84da0f101af3..8e19a6e99671816c7fa1492f2110ab3fbf146a63 100755 (executable)
@@ -13,7 +13,7 @@ find_config() {
                esac
                config_get device "$ifn" device
                for ifc in $device $iface $ifaces; do
-                       [ "$ifc" = "$1" ] && {
+                       [ ."$ifc" = ."$1" ] && {
                                echo "$ifn"
                                return 0
                        }
@@ -74,7 +74,7 @@ prepare_interface() {
        # if we're called for the bridge interface itself, don't bother trying
        # to create any interfaces here. The scripts have already done that, otherwise
        # the bridge interface wouldn't exist.
-       [ "$iface" = "br-$config" ] && return 0;
+       [ "br-$config" = "$iface" ] && return 0;
 
        [ -f "$iface" ] && return 0;
        
@@ -181,7 +181,7 @@ setup_interface() {
                                $DEBUG ifconfig "$iface" "$ipaddr" ${netmask:+netmask "$netmask"}
 
                        # don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp)
-                       [ "$proto1" != "$proto" ] && dhcpopts="-n -q"
+                       [ ."$proto1" != ."$proto" ] && dhcpopts="-n -q"
                        $DEBUG eval udhcpc -t 0 -i "$iface" ${ipaddr:+-r $ipaddr} ${hostname:+-H $hostname} -b -p "$pidfile" ${dhcpopts:- -R &}
                        lock -u "/var/lock/dhcp-$iface"
                ;;
index 607ee2e9db8ff666bb2c8b71b909e1f857167e35..57011d1523b589c6eeb3731fdc03731816bfaa74 100755 (executable)
@@ -5,7 +5,7 @@ export HOTPLUG_TYPE="$1"
 
 # bypass the normal hotplug path for firmware loading
 # would otherwise cause problems with drivers like bcm43xx
-[ "$HOTPLUG_TYPE" = "firmware" -a "$ACTION" = "add" ] && {
+[ "firmware" = "$HOTPLUG_TYPE" -a "add" = "$ACTION" ] && {
        [ -f "/lib/firmware/$FIRMWARE" ] && {
                echo 1 > "/sys$DEVPATH/loading"
                cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data"
index 5a98003b1de0dbf3d13094b19e21e0e08fd9d86c..8ec568ff6b5ad08498617129e4fd58f6c3ed4944 100755 (executable)
@@ -20,7 +20,7 @@ config_get proto "$cfg" proto
 [ -z "$proto" ] && { echo "interface not found."; exit; }
 
 config_get iface "$cfg" device
-[ "$proto" = "static" ] && {
+[ "static" = "$proto" ] && {
        env -i ACTION="ifdown" INTERFACE="$cfg" DEVICE="$iface" PROTO=static /sbin/hotplug-call "iface" &
 }
 
@@ -58,5 +58,5 @@ for dev in $ifname $device; do
 done
 
 config_get iftype "$cfg" type
-[ "$iftype" = "bridge" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null
+[ "bridge" = "$iftype" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null
 
index 6e8e41845874e4fa42bb18a62886eb00156e929c..2ca5d22cb87b62be881841d200ac922137af57cb 100755 (executable)
@@ -38,7 +38,7 @@ bridge_interface() {(
 wifi_updown() {
        for device in ${2:-$DEVICES}; do (
                config_get disabled "$device" disabled
-               [ "$disabled" == "1" ] && {
+               [ 1 == "$disabled" ] && {
                        echo "'$device' is disabled"
                        set disable
                }