Commit 72617e7f authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Add mandatory reboot for Cubietruck legacy kernel when switching to AP mode...

Add mandatory reboot for Cubietruck legacy kernel when switching to AP mode since unloading module does not work.
parent 3ce85ae5
......@@ -226,6 +226,7 @@ function jobs ()
"WiFi" )
# disable AP mode on certain adapters
wlan_exceptions "off"
[[ "$reboot_module" == true ]] && dialog --backtitle "$BACKTITLE" --title " Warning " --msgbox "\nReboot is required for this adapter to switch to STA mode" 7 62 && reboot
nmtui-connect
;;
......@@ -456,6 +457,7 @@ function jobs ()
sleep 2
ifup $WIRELESS_ADAPTER 2> /dev/null
echo "nameserver 8.8.8.8" > /etc/resolvconf/resolv.conf.d/base
[[ "$reboot_module" == true ]] && dialog --backtitle "$BACKTITLE" --title " Warning " --msgbox "\nReboot is required for this adapter to switch to AP mode" 7 61 && reboot
# reload services
reload-nety "reload"
fi
......
......@@ -335,10 +335,17 @@ function exceptions ()
#
function wlan_exceptions ()
{
reboot_module=false
[[ -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
# Cubietruck
[[ -n "$(lsmod | grep -w ap6210)" && $1 = "on" ]] && \
echo 'options ap6210 op_mode=2' >/etc/modprobe.d/ap6210.conf && reboot_module=true
[[ -n "$(lsmod | grep -w ap6210)" && $1 = "off" ]] && \
rm /etc/modprobe.d/ap6210.conf && reboot_module=true
}
#-----------------------------------------------------------------------------------------------------------------------------------------#
......
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