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.shbelow 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