--- /lib/rcscripts/net.modules.d/iwconfig +++ /lib/rcscripts/net.modules.d/iwconfig @@ -200,6 +200,7 @@ return 1 fi dessid=${ESSID//\\\\/\\\\} + ESSIDVAR=${ESSID//[![:word:]]/_} # We only change the mode if it's not the same local cur_mode=$( iwconfig_get_mode ${iface} ) @@ -212,9 +213,8 @@ fi key=$( iwconfig_get_wep_key ) - e=$( iwconfig ${iface} key ${key} 2>&1 ) + e=$( eval "iwconfig ${iface} key ${key} 2>&1" ) if [[ -n ${e} && ${key} != off ]]; then - e=$( get_essid_var ${essid} ) ewarn "${iface} does not support setting keys" ewarn "or the parameter \"mac_key_${ESSIDVAR}\" or \"key_${ESSIDVAR}\" is incorrect" fi @@ -335,11 +335,10 @@ key="off" vewarn "\"${dessid}\" is not WEP enabled - ignoring setting" fi - e=$( iwconfig ${iface} key ${key} 2>&1 ) + e=$( eval "iwconfig ${iface} key ${key} 2>&1" ) if [[ -n ${e} && ${key} != off ]]; then - e=$( iwconfig_get_essid_var ${essid} ) ewarn "${iface} does not support setting keys" - ewarn "or the parameter \"mac_key_${e}\" or \"key_${e}\" is incorrect" + ewarn "or the parameter \"mac_key_${ESSIDVAR}\" or \"key_${ESSIDVAR}\" is incorrect" return 1 fi [[ ${key} != off ]] && w=$( iwconfig_get_wep_status ${iface} )