From 6b55d6d976105d77ca5eb78b581cbab8cb5cb7c8 Mon Sep 17 00:00:00 2001 From: zribiahmed Date: Thu, 23 May 2013 16:21:43 +0000 Subject: [PATCH] fix wepkeyindex when wpa or wpa2 is activated --- src/scripts/functions/lan_device | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scripts/functions/lan_device b/src/scripts/functions/lan_device index 6052c0b..eeed214 100644 --- a/src/scripts/functions/lan_device +++ b/src/scripts/functions/lan_device @@ -466,9 +466,15 @@ local wlan_num="$3" local val="" local type="xsd:unsignedInt" local permissions="" +local encryption="" case "$action" in get_value) - val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].key` + encryption=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].encryption` + if [ "$encryption" = "wep-shared" -o "$encryption" = "wep-open" ]; then + val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q get wireless.@wifi-iface[$num].key` + else + val="" + fi let num=$num+1 freecwmp_output "InternetGatewayDevice.LANDevice.$lan_num.WLANConfiguration.$wlan_num.WEPKeyIndex" "$val" "$permissions" "$type" ;;