Hi bmarkus,
The iwlist command doesn't always execute succesfull on the first try.
Could we change this part of the wifi.sh script:
echo "Standby for scan of available networks..."
ifconfig "$WIFI" up 2>/dev/null
sleep 2
iwlist "$WIFI" scanning |
awk -v wifi="$WIFI" -v dbfile="$DB" -v mode="$MODE" -v ptmp="$PTMP" '
To this?:
echo "Standby for scan of available networks..."
ifconfig "$WIFI" up 2>/dev/null
# try for 5 times to get a succesfull iwlist
for i in $(seq 1 5)
do
sleep 1
iwlist "$WIFI" scanning >/dev/null
if [[ $? -eq 0 ]]
then
break
fi
done
iwlist "$WIFI" scanning |
awk -v wifi="$WIFI" -v dbfile="$DB" -v mode="$MODE" -v ptmp="$PTMP" '
This will do a maximum tries of 5 before continuing with the rest of the script.
The auto start option might be a bit more durable with this change.
Be aware, it's been awhile since I did some unix scripting, so I'm a bit rusty..
I didn't test it either..