Skip to content

Commit

Permalink
Fixed Issue #3 Reported: Updater Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sh4nx0r committed Sep 23, 2018
1 parent 8fcccf3 commit a8dc90c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions rapidscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ def url_maker(url):
host = host[4:]
return host

def check_internet():
os.system('ping -c1 github.com > rs_net 2>&1')
if "0% packet loss" in open('rs_net').read():
val = 1
else:
val = 0
os.system('rm rs_net > /dev/null 2>&1')
return val


# Initializing the color module class
class bcolors:
HEADER = '\033[95m'
Expand Down Expand Up @@ -702,6 +712,12 @@ def stop(self):
logo()
print "RapidScan is updating....Please wait.\n"
spinner.start()
# Checking internet connectivity first...
rs_internet_availability = check_internet()
if rs_internet_availability == 0:
print "\t"+ bcolors.BG_ERR_TXT + "There seems to be some problem connecting to the internet. Please try again or later." +bcolors.ENDC
spinner.stop()
sys.exit(1)
cmd = 'sha1sum rapidscan.py | grep .... | cut -c 1-40'
oldversion_hash = subprocess.check_output(cmd, shell=True)
oldversion_hash = oldversion_hash.strip()
Expand Down

0 comments on commit a8dc90c

Please sign in to comment.