Skip to content

Commit

Permalink
fixed autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenGietz committed May 7, 2020
1 parent ab03a1f commit db449f6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pacu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import shlex
import subprocess
import datetime
import sys
import time
import traceback
Expand Down Expand Up @@ -320,16 +321,16 @@ def check_for_updates(self):
with open('./last_update.txt', 'r') as f:
local_last_update = f.read().rstrip()

latest_update = requests.get('https://raw.githubusercontent.com/RhinoSecurityLabs/pacu/master/last_update.txt').text.rstrip()
latest_update = requests.get('https://raw.githubusercontent.com/RhinoSecurityLabs/pacu/regions/last_update.txt').text.rstrip()

local_year, local_month, local_day = local_last_update.split('-')
datetime_local = datetime.date(local_year, local_month, local_day)
datetime_local = datetime.date(int(local_year), int(local_month), int(local_day))

latest_year, latest_month, latest_day = latest_update.split('-')
datetime_latest = datetime.date(latest_year, latest_month, latest_day)
datetime_latest = datetime.date(int(latest_year), int(latest_month), int(latest_day))

if datetime_local < datetime_latest:
print('Pacu has a new version available! Clone it from GitHub to receive the updates.\n git clone https://github.com/RhinoSecurityLabs/pacu.git')
print('Pacu has a new version available! Clone it from GitHub to receive the updates.\n git clone https://github.com/RhinoSecurityLabs/pacu.git\n')

def key_info(self, alias=''):
""" Return the set of information stored in the session's active key
Expand Down

0 comments on commit db449f6

Please sign in to comment.