| … | |
… | |
| 69 | done |
69 | done |
| 70 | } |
70 | } |
| 71 | |
71 | |
| 72 | iwconfig_set_mode() { |
72 | iwconfig_set_mode() { |
| 73 | local x= opt= unopt="hostap adhoc" |
73 | local x= opt= unopt="hostap adhoc" |
| 74 | case "${mode}" in |
74 | case "$1" in |
| 75 | master|hostap) unopt="adhoc" opt="hostap" ;; |
75 | master|hostap) unopt="adhoc" opt="hostap" ;; |
| 76 | ad-hoc|adhoc) unopt="hostap" opt="adhoc" ;; |
76 | ad-hoc|adhoc) unopt="hostap" opt="adhoc" ;; |
| 77 | esac |
77 | esac |
| 78 | for x in ${unopt} ; do |
78 | for x in ${unopt} ; do |
| 79 | ifconfig "${IFACE}" -mediaopt ${x} |
79 | ifconfig "${IFACE}" -mediaopt ${x} |
| … | |
… | |
| 472 | x=${x:-managed} |
472 | x=${x:-managed} |
| 473 | case "${x}" in |
473 | case "${x}" in |
| 474 | ad-hoc|adhoc|hostap|master) iwconfig_setup_specific "${x}" ;; |
474 | ad-hoc|adhoc|hostap|master) iwconfig_setup_specific "${x}" ;; |
| 475 | esac |
475 | esac |
| 476 | |
476 | |
| 477 | if [ "${x}" != "managed" -a "${x}" != "auto" ] ; then |
477 | if [ "${x}" != "managed" -a "${x}" != "auto" -a "${x}" != "ad-hoc" -a "${x}" != "adhoc" -a ${x} != "master" ] ; then |
| 478 | eerror "Only managed, ad-hoc, master and auto modes are supported" |
478 | eerror "Only managed, ad-hoc, master and auto modes are supported" |
| 479 | return 1 |
479 | return 1 |
| 480 | fi |
480 | fi |
| 481 | |
481 | |
| 482 | # Has an ESSID been forced? |
482 | # Has an ESSID been forced? |