Raspberry Pi wifi reconnect every 5 min

We enter this crontab entry and try to reconnect wifi every 5 mins
*/5 * * * * /home/sertac/wifi_reconnect.sh
below you can find script content
sertac@pz:~ $ cat /home/sertac/wifi_reconnect.sh
ping -c2 8.8.8.8 > /dev/null
if [ $? != 0 ]; then
    ifdown --force wlan0
    sleep 5
    ifup wlan0
    sleep 10
    systemctl restart ssh
fi

Comments

Popular posts from this blog

Pyppeteer fix for BrowserError: Browser closed unexpectedly

overlay filesystem and containers

How to add pagination to django comments for your model