diff options
Diffstat (limited to 'src/backend/checkenv.py')
-rw-r--r-- | src/backend/checkenv.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/checkenv.py b/src/backend/checkenv.py index c8152bf..124ba76 100644 --- a/src/backend/checkenv.py +++ b/src/backend/checkenv.py @@ -3,6 +3,19 @@ import os import subprocess import sisyphus.getenv +import urllib.request + + +def connectivity(): + is_online = int() + + try: + urllib.request.urlopen("http://www.google.com", timeout=5) + is_online = int(1) + except urllib.error.URLError: + is_online = int(0) + + return is_online def root(): |