SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

glen glen at pld-linux.org
Sun Oct 28 17:57:14 CET 2007


Author: glen
Date: Sun Oct 28 17:57:14 2007
New Revision: 8888

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- handle wlan different four keys

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network	(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.network	Sun Oct 28 17:57:14 2007
@@ -520,8 +520,23 @@
 		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
 


More information about the pld-cvs-commit mailing list