wifi-reset/wifi-reset.sh
Drew Fustini 15ea1f2a61 Add delay to allow wifi device to become ready
Attempt to resolve Adafruit customer reported issue for the OURLINK WiFi USB Adapter:
https://forums.adafruit.com/viewtopic.php?f=49&t=86761
2016-01-02 21:26:46 -06:00

9 lines
416 B
Bash
Executable file

#!/bin/bash
# Bring all wifi interfaces down.
# Identify wifi interfaces as rows from standard output of iwconfig (NOT standard
# error, those are non-wifi interfaces) which start without whitespace.
sleep 30
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done
# Bring all wifi interfaces up.
sleep 30
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done