Skip to content

Commit

Permalink
Reuse __version__ in version check.
Browse files Browse the repository at this point in the history
Co-authored-by: spameier <spameier@users.noreply.github.com>
  • Loading branch information
spameier and spameier authored May 2, 2024
1 parent fb5f648 commit 08da62a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions recon/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,16 @@ def _check_version(self):
if self._check:
pattern = r"'(\d+\.\d+\.\d+[^']*)'"
remote = 0
local = 0
try:
remote = re.search(pattern, self.request('GET', 'https://raw.githubusercontent.com/lanmaster53/recon-ng/master/VERSION').text).group(1)
local = re.search(pattern, open('VERSION').read()).group(1)
except Exception as e:
self.error(f"Version check failed ({type(e).__name__}).")
#self.print_exception()
if remote != local:
if remote != __version__:
self.alert('Your version of Recon-ng does not match the latest release.')
self.alert('Please consider updating before further use.')
self.output(f"Remote version: {remote}")
self.output(f"Local version: {local}")
self.output(f"Local version: {__version__}")
else:
self.alert('Version check disabled.')

Expand Down

0 comments on commit 08da62a

Please sign in to comment.