I am noticing random WiFi connection problem at boot, so I am trying to troubleshoot.
Of course, I checked correctness of my wifi settings and routing.
In startput.sh you are resetting the network with
/etc/init.d/networking restart but Debian reports that this is deprecated because it may not enable again some interfaces. Don’t you believe that it could be changed with:
ifdown wlan0 && ifup wlan0 ?