openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting » Check For Internet Connection From Script?

Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-Apr-2008, 09:41
Rhaddamant
Guest
 
Posts: n/a
Default

how can i check is internet connection available from a shell script?
i mean general check not hardware specific

tip: checkproc rcnetwork doesn't work out

thanks in advance

PS sorry for multiple posting :-) reply here, pls
  #2 (permalink)  
Old 02-Apr-2008, 09:54
ken_yap
Guest
 
Posts: n/a
Default

You could ping a router somewhere at your ISP. Note that does not guarantee that you can reach any host, just that you are connected to your ISP. The router must also respond to pings. You can discover the routers in the path using traceroute.

if ping -c 3 some.router.at.isp.com
then
echo 'Have connectivity'
fi
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2