]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- handle wlan different four keys
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 28 Oct 2007 16:57:14 +0000 (16:57 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Sun, 28 Oct 2007 16:57:14 +0000 (16:57 +0000)
svn-id: @8888

sysconfig/network-scripts/functions.network

index d4c0de9ccf059b0a0bc74850d2071ca5a2186d62..bc41f83f9039ad1da3d4f5fc88bbc179e7be30fa 100644 (file)
@@ -520,8 +520,23 @@ wireless_param()
                iwconfig ${device} frag "$val"
 
        local wlan_encryption="$(eval echo \$${prefix}WLAN_ENCRYPTION)"
-       if val="$(eval echo \$${prefix}WLAN_KEY)" && [ -n "$val" ]; then
-               iwconfig ${device} key "$val"
+       local wlan_key="$(eval echo \$${prefix}WLAN_KEY)"
+       # TODO: well, actually shouldn't set WLAN_KEY if other keys than current are set
+       if [ -n "$wlan_key" ]; then
+               # wlan key can contain index of key to set
+               # to set other than current keys suffix with 1-4:
+               local idx
+               for idx in 1 2 3 4; do
+                       val="$(eval echo \$${prefix}WLAN_KEY_$idx)"
+                       [ "$val" ] || continue
+                       iwconfig ${device} key "[$idx] $val"
+               done
+               if val="$(eval echo \$${prefix}WLAN_KEY_CURRENT)" && [ "$val" ]; then
+                       iwconfig ${device} key "[$val]"
+               else
+                       iwconfig ${device} key "$wlan_key"
+               fi
+
                [ -n "$wlan_encryption" ] && iwconfig ${device} key "$wlan_encryption"
        fi
 
This page took 0.127177 seconds and 4 git commands to generate.