2016-09-01 07:05:40 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Disable wifi, and remove all modules.
|
|
|
|
|
|
|
|
killall udhcpc default.script wpa_supplicant 2>/dev/null
|
|
|
|
|
2018-07-01 15:35:12 +00:00
|
|
|
[ "${WIFI_MODULE}" != "8189fs" ] && [ "${WIFI_MODULE}" != "8192es" ] && wlarm_le -i "${INTERFACE}" down
|
2018-05-01 12:49:37 +00:00
|
|
|
ifconfig "${INTERFACE}" down
|
2016-09-01 07:05:40 +00:00
|
|
|
|
2016-12-12 22:36:07 +00:00
|
|
|
# Some sleep in between may avoid system getting hung
|
|
|
|
# (we test if a module is actually loaded to avoid unneeded sleeps)
|
2017-04-11 09:28:01 +00:00
|
|
|
if lsmod | grep -q "${WIFI_MODULE}"; then
|
2018-05-10 10:26:07 +00:00
|
|
|
usleep 250000
|
2018-06-16 21:05:20 +00:00
|
|
|
rmmod "${WIFI_MODULE}"
|
2016-12-12 22:36:07 +00:00
|
|
|
fi
|
2017-04-11 09:28:01 +00:00
|
|
|
if lsmod | grep -q sdio_wifi_pwr; then
|
2018-05-10 10:26:07 +00:00
|
|
|
usleep 250000
|
2018-06-16 21:05:20 +00:00
|
|
|
rmmod sdio_wifi_pwr
|
2016-12-12 22:36:07 +00:00
|
|
|
fi
|