Commit b9281d34 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Add exceptions - changing to AP mode with a parameter, where needed. Currently...

Add exceptions - changing to AP mode with a parameter, where needed. Currently enabld only for dhd module (ap6212) chipset.
parent 6c309f10
...@@ -19,6 +19,12 @@ if [[ $? -ne 0 ]]; then ...@@ -19,6 +19,12 @@ if [[ $? -ne 0 ]]; then
read -n 1 -s -p "Warning. Configurator can't work properly without internet connection. Press CTRL C to stop to stop or any key to ignore and continue." read -n 1 -s -p "Warning. Configurator can't work properly without internet connection. Press CTRL C to stop to stop or any key to ignore and continue."
fi fi
function wlan_exceptions ()
{
[[ -n "$(lsmod | grep -w dhd)" && $1 = "on" ]] && echo 'options dhd op_mode=2' >/etc/modprobe.d/ap6212.conf && rmmod dhd && modprobe dhd
[[ -n "$(lsmod | grep -w dhd)" && $1 = "off" ]] && rm /etc/modprobe.d/ap6212.conf && rmmod dhd && modprobe dhd
}
function get_wlan_interface () function get_wlan_interface ()
{ {
# search for wlan interfaces and provide a selection menu if there are more than one # search for wlan interfaces and provide a selection menu if there are more than one
...@@ -120,6 +126,8 @@ while true; do ...@@ -120,6 +126,8 @@ while true; do
dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse --yesno "\nHostapd service is configured and running.\n\nDo you want to stop the service?" 9 57 dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse --yesno "\nHostapd service is configured and running.\n\nDo you want to stop the service?" 9 57
[[ $? = 0 ]] && service hostapd stop && sed -i "s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd [[ $? = 0 ]] && service hostapd stop && sed -i "s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd
else else
# change special adapters to AP mode
wlan_exceptions ("on")
# check for WLAN interfaces # check for WLAN interfaces
get_wlan_interface get_wlan_interface
# display dialog # display dialog
...@@ -233,6 +241,9 @@ while true; do ...@@ -233,6 +241,9 @@ while true; do
;; ;;
"Wireless" ) "Wireless" )
# disable AP mode on certain adapters
wlan_exceptions ("off")
# scan for wifi modules
array=( $(iw dev | grep Interface | sed -e "s/\tInterface//") ) array=( $(iw dev | grep Interface | sed -e "s/\tInterface//") )
declared_wlans=0; declared_wlans=0;
echo ${#array[@]} echo ${#array[@]}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment