Home > BashScripts, Linux > Linux connection check

Linux connection check

March 20th, 2009 Leave a comment Go to comments

Ubuntu 8.10 Hardy Connectivity Check, Internet Connection test and repair.
I am not sure why but my ubuntu at home keeps losing the connection and I have to manualy disable and enable Network Manager.
So I wrote this:

-> Each 10 minutes test the connections by calling the script
crontab -e
*/10 * * * * bash /home/<userx>/testnet.sh
-> Save changes (CTRL-X, Y)
# cd /home/<userx>
# vim testnet.sh
-> copy and paste this:
#!/bin/bash
#Script to test internet connection and restart Network Manager if it fails.
ping -c 2 -w 3 google.com || /etc/init.d/NetworkManager restart

chmod +x  testnet.sh

ref.
NetworkManager

  1. No comments yet.
  1. No trackbacks yet.

VAMOVE *

*