freebsd network problem and restarts

Andy Rozman andy at triera.net
Sat Dec 1 08:53:58 PST 2007


Hi !

Lately after install of new hardware, I upgraded to FreeBSD 7.0 AMD64. 
Problem is that every few days (5 or so) computer network connection is 
lost, if I restart computer everything is OK again....

What I need is script that will determine if connection is valid and if 
not restarting the machine. I plan to run this script by cron every 
hour... I am very lousy with writing scripts of anykind, so I would need 
little help from you...

Script must do following things:
1. Check if connection is alive by pinging one site, www.google.com 
should be good example
2a) If connection is ok, script is finished
2b) There is no response following stuff must happen:
         a.) Wait for 10 minutes (or some specified time) and try step 1 
again if fails following thing are done
         b.) Write line into log that connection is failed
         c.) Inject mail message to local sendmail instance (so that 
mail is sent after restart)
         d.) Reboot computer
 
If someone knows about script that does this things, I would be very 
thankful if he/she could help me. If not I would be thankful for any 
help in creating such script.

Thank you in advance.
Andy


More information about the freebsd-hackers mailing list