okreader/files/disable-wifi.sh
Cosmin Gorgovan 5bd93e7ff8 Fixes for the disable-wifi and release-ip scripts
disable-wifi: use pkill instead of killall, which is unavailable
release-ip: reset the ip address of the interface
2017-03-27 00:29:04 +01:00

18 lines
362 B
Bash
Executable File

#!/bin/sh
# Disable wifi, and remove all modules.
pkill dhcpcd
pkill wpa_supplicant
ifconfig wlan0 down
# Some sleep in between may avoid system getting hung
# (we test if a module is actually loaded to avoid unneeded sleeps)
if lsmod | grep -q $WIFI_MODULE ; then
rmmod $WIFI_MODULE
fi
if lsmod | grep -q sdio_wifi_pwr ; then
rmmod sdio_wifi_pwr
fi