I don't know if here is the right thread to ask, but I having some problems to connect wifi when the network is down.
I'm using the crontab job to reboot every 2hours, but some times the wifi network isn't connecting automatically, and need check network connection every 5min after reboot.
I'm using ubuntu 16.04.03 LTS
The script to check wifi network is:
#!/bin/bash
x='ping -c2 google.com 2>&1 | grep unknown'
if [ ! "$x" = "" ]; then
echo "It's down! Attempting to restart."
service network-manager restart
fi
and added to crontab with
*/5 * * * * sh /sbin/wifi.sh
but it don't working.
Please if I misstaking some code, tell me the best way to do.
P.S: I just want to stay connected with the pool, without going there and restarting manually, I also do maintence via ssh, but without network it's sucks.