I think I caught some sort of loop weirdness in the wifi.sh script ...
Symptom:
Bring up a wireless acesss point for the first time and supply the WRONG wpa password. Fat fingered mistake. Wont connect of course.
Wait a little bit for the device/resource to not be busy and try again. But this time supply the CORRECT password.
It still won't connect, even with the right password. (don't trust me, try this yourself.
The only thing that will cure that is to ugh, reboot and it will now accept the correct password.
Supplementary info:
my wireless device as seen in ifconfig is wlp2so
Noticed another loop of sorts that it can't get out of:
Let's say you provide the right password straight off the bat and connect. But now you issue another wifi.sh to perform a disconnect and scan. So you disconnect and Quit instead of scanning.
Later, you bring up wifi.sh again, but instead of scanning, it says it is already connected, even though you chose to disconnect and quit earlier.
Sure, I can bring it down manually with
sudo ifconfig wlp2so down
but wondering why wifi.sh isn't doing that when I tell it to disconnect and quit.
I'm looking at the awesome script at /usr/local/bin/wifi.sh and am wondering if busybox or something else is garbling my wlp2so device and confusing things?