I have a home server running Ubuntu 14.04.3 LTS. It's a desktop connected to my wi-fi connection via an USB adaptor. The issue here is that randomly it gets disconnected from the network and asks again for the password (which is always the same and correctly stored, in fact it's already typed in the dialog that pops up) and I have to manually click or press enter to connect it again.
I have added to my crontab this small script
#!/bin/bash if ! [ "$(ping -c 1 google.com)" ]; then service network-manager restart fi
it runs every 5 minutes
*/5 * * * * /home/***/keepalive.sh
but it does not seem to help and i often find my server disconnected. What am I doing wrong?