check if internet connection was lost
1) i use ubuntu 6.06 on a laptop (acer travelmate 290) with an integrated wlan device. there is a wlan-router (netgear fwg114p) which connects to internet (isdn). connection to the network works, also accessing the internet.
2) the first thing: if i download large files or try to access a lot of websites at the same time, sometimes the router quits the connection to internet. he just dials in again, but then he gets another ip, and thats not cool cause some tools like gaim are confused by the new ip and need to be reconnected. i don't know why the connection gets lost, maybe the router gets afraid of the huge dataload, maybe the firewall thinks it's a hacker attack. maybe the new IP the router gets is one which was assigned to a user who used filesharing tools and other users still port-scan the ip which the router maybe doesn't like.
this occours using linux, win, other laptops, desktop pcs, connected by wlan or by cable...doesn't matter how and who is connected.
it works if the laptop is directly connected to the modem, so it must be the router who just hangs up. if somebody knows a solution for this, would be nice if you tell, thanks in advice.
3) the actual reason why i'm posting: gaim needs about 15 minutes until it knows that the connection was lost and reconnects by itself. if i don't see that the router reconnected, then i don't know that i can't receive any messages anymore. that's really annoying.
so i thought about a litte script or c or java program which checks every minute if the router is still connected to the internet with the same ip as 1 minute ago. if not, it should notify by playing a sound and/or flashing a window, maybe also tell gaim to reconnect (if that's possible), or show a button which automatically stops the gaim-process and starts gaim again. but i just can't find out how to determine the ip used for the internet connection, and also not how to write a bash script which does the desired things. i can write a java program doing the other things, but how to find out the ip?
maybe somebody knows other solutions or maybe there is a tool which can do this...
thanks in advice!