Ok, I've got something that may work if your eth1 is wired, but I'm having trouble making it work for wireless. This is assuming a dhcp connection ( but it can be modified for static ips). Try it in your /etc/crontab set to run every however many number of hours you want as root.
Code:
if ! ping -c 4 www.google.com; then ifup eth1; dhclient eth1; fi;
Give it a try, it may need to be tweaked.
OK, for wireless, you can try this:
Code:
if ! ping -c 4 www.google.com; then ifconfig eth1;
iwconfig eth1 essid NETWORK_ID key WIRELESS_KEY;
dhclient eth1;
fi;
from: http://www.ghacks.net/2009/04/14/con...-command-line/
Bookmarks