Well, now for the first post...
I now have a script working that automatically restarts my network adapter if pings start to time out. I needed this because I have a flaky router and I want my Server (in my closet) to automatically recognize when it can connect again w/o having to hook up a monitor and type ifup -a.
So the script is as follows:
# This script will ping a known host and restart the interface
# if the ping fails
# 9/6/06 RCH
# usage: keepwirelessup.sh [sleep_time]
if [ -n "$1" ]; then
while true; do
ping -c 1 $PING_HOST &> /dev/null
if [ $? -ne "0" ]; then
echo `date` Restarting Wireless... >> /var/log/$NAME.log
I copied this script to /etc/init.d/, changed the permissions and ownership to root and then
added these lines to my /etc/rc.local file:
# Run my custom Keep Wireless Script Up
test -f $KEEP_WIRELESS_UP && nice -n -10 $KEEP_WIRELESS_UP &
Now, theoretically, my server should automatically reconnect when the connection resumes to the router.