You are not logged in.
After a recent cable modem upgrade, my arch box appears to lose connectivity while I am working on it remotely. If I reboot it, it re-establishes the connection and starts working again..
Since this seems to happen while I am working remotely, it becomes very frustrating because I cannot troubleshoot it until I get home. I was curious if anyone knew or had a script or daemon that frequently checks for internet connectivity. If it doesn't have connectivity, then reboots the system or restarts networking.. This would be helpful so I could at least remotely connect and determine what is causing the issue..
Anyone?
EDIT: I guess this is pretty simple to run a cron job to check connectivity via a script and reboot if connectivity is lost..Here's what I got so far.. Anyone have anything else??
#!/bin/bash
WGET="/usr/bin/wget"
$WGET -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
reboot
else
echo "connection working.."
fi
Last edited by brenix (2011-01-05 19:35:10)
Offline
instead of rebooting, cant you just bring the interface down and up again?
how is your network set up?
/etc/rc.d/network restart should do it.
/etc/rc.d/net-auto-wired restart would work too
Offline
instead of rebooting, cant you just bring the interface down and up again?
He can't deal with anything on the computer if he is remotely logged in and then the network goes down.
Instead of downloading google with wget why not just ping it three times (ping -c 3 www.google.com). If the ping fails then reboot. Put it in a script and run it from a cron job every 5 mins.
Offline
thats what I had done is have it just ping instead. Thanks for the tips..
Oddly enough it appears the network is stable now too.. good to have in case it comes back..
Offline
i meant for him to have the cronjob bring the interface down and up again.
Offline