A different approach would be to look if n7us.net is availabĺe:

Code:
ping -c1 n7us.net >/dev/null 2>&1 && echo success
or
Code:
ping -c1 n7us.net >/dev/null 2>&1 || exit 1
eth0 may be up in the local net.
may be up, but no dns-server found ...

-c1 will only ping one time.
>/dev/null sends the output to 'nowhere'
2>&1 sends errormessage to the location, where the output goes ('nowhere' too)
&& (read: AND) will execute the following code only if the first command succeeded. Here you may call a script-function, if your command is too complex.

|| (read: OR [exclusive]) will execute the following command (exit 1) only, if the previous failed.
So your code for continuing when everything is fine will just follow.

In general, an excellent scripting guide is found here:
http://freshmeat.net/projects/advanc...criptingguide/

Do you want to run the script totally automated?
If you want to login, where you have to wait for a login-prompt, you have to use 'expect' - which isn't installed on my system - why?