a script to check whether internet is up