Python script to check network connection
I need one script to check my network, because it usually down. So code little python script :)
import winsound
import urllib2
import time
def internet_on():
try:
response=urllib2.urlopen('74.125.113.99',timeout=1)
return True
except urllib2.URLError as err: pass
return False
while 1:
if internet_on() == 1:
print "Network on"
else:
print "Network off"
winsound.Beep(500,500)
time.sleep(5)
pass
------------------------------------------------------------
Thanks for reading
--------------------------------------------------------------------------
Security Research
All my Lab:
Linux Lab -- window and Cisco Lab
to be continued - I will update more.
Nam Habach