For some people using garbage WiFi adapter. You might experience some bugs you can't access the internet on startup. You'll have to re-enable WiFi or restart the computer. This is very annoying when you setup RTC wakeup for your PC and remoting your PC from outside.
This script will check the internet for every period of time. If there's no internet access script will try to re-enable WiFi. If the issue still persists, the script will try to restart PC.
All the variables are designed to be easy to edit. You can change it in the first 4 lines of codes.