195 |
# write default cfg from skeleton |
# write default cfg from skeleton |
196 |
cat ${WIRELESS_WPA_SKEL} > ${WIRELESS_WPA_CONFIG} |
cat ${WIRELESS_WPA_SKEL} > ${WIRELESS_WPA_CONFIG} |
197 |
|
|
198 |
|
local wpa_proto |
199 |
|
case ${WIRELESS_AUTH_MODE} in |
200 |
|
wpa) wpa_proto="WPA" ;; |
201 |
|
wpa2) wpa_proto="WPA2" ;; |
202 |
|
esac |
203 |
|
|
204 |
# setup the network entry |
# setup the network entry |
205 |
sed -i -e "s:@WIRELESS_ESSID@:${WIRELESS_ESSID}:g" \ |
sed -i -e "s:@WIRELESS_ESSID@:${WIRELESS_ESSID}:g" \ |
206 |
-e "s:@WIRELESS_KEY@:${WIRELESS_KEY}:g" \ |
-e "s:@WIRELESS_KEY@:${WIRELESS_KEY_ASCII}:g" \ |
207 |
|
-e "s:@WIRELESS_AUTH_MODE@:${wpa_proto}:g" \ |
208 |
${WIRELESS_WPA_CONFIG} |
${WIRELESS_WPA_CONFIG} |
209 |
fi |
fi |
210 |
|
|
252 |
[[ -n ${WIRELESS_NICK} ]] && iwconfig "${iface}" nick "${WIRELESS_NICK}" |
[[ -n ${WIRELESS_NICK} ]] && iwconfig "${iface}" nick "${WIRELESS_NICK}" |
253 |
|
|
254 |
case "${WIRELESS_AUTH_MODE}" in |
case "${WIRELESS_AUTH_MODE}" in |
255 |
wpa) config_wireless_wpa "${iface}" ;; |
wpa|wpa2) config_wireless_wpa "${iface}" ;; |
256 |
wep|on) config_wireless_wep "${iface}" ;; |
wep|on) config_wireless_wep "${iface}" ;; |
257 |
off) iwconfig "${iface}" enc off ;; |
off) iwconfig "${iface}" enc off ;; |
258 |
esac |
esac |
259 |
} |
} |
260 |
|
|