Report comment

Hi Mark

Does your SSID contain anything other than letters, numbers or a space? If it contains an apostrophe, comma or quote marks then it won't be recognised. The script gets the SSID's from your wpa_supplicant file but to do that commas, quotation marks and apostrophes are striped out. I'm guessing that as your wifi works fine normally your SSID is getting altered.

If you add a line to the script and run it manually again you can see what it is checking for.
Find this section:

for ssid in "${ssidsmac[@]}"
do
if (echo "$ssidreply" | grep "$ssid") >/dev/null 2>&1
then
#Valid SSid found, passing to script
ssidChk=$ssid
return 0
else
#No Network found, NoSSid issued"
ssidChk='NoSSid'
fi
done
}


and add the echo line after do

for ssid in "${ssidsmac[@]}"
do
echo "Checking SSID " "$ssid"
if (echo "$ssidreply" | grep "$ssid") >/dev/null 2>&1
then
#Valid SSid found, passing to script
ssidChk=$ssid
return 0

If your SSID is the issue can you give me an example of how it is written, I can see what can be done but you may just have to change the SSID in your router.