Skip to content

Commit

Permalink
update option
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Mar 3, 2020
1 parent 5163788 commit 9bed8a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 11 additions & 2 deletions lib/cli/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,24 @@ def handle_config(line):
opt = line.strip().split(':')[0]
val = line.strip().split(':')[1]

if opt == "auto-update" and val.lower() in ("false", "no", "0"):
self.auto_update = False
if opt == "auto-update":
if val.lower() in ("false", "no", "0"):
self.auto_update = False
else:
self.auto_update = True

try:
conf = open(self.config_file)

for line in conf.readlines():
handle_config(line)

except (FileNotFoundError, IndexError):
self.auto_update = True
finally:
if self.auto_update:
update_job = Process(target=update,)
update_job.start()

def command(self, user_cmd):
'''
Expand Down Expand Up @@ -141,6 +149,7 @@ def attack(self):
if scanner_instance is None:
return
scanner_instance.scan()

return

except (EOFError, KeyboardInterrupt, SystemExit):
Expand Down
4 changes: 0 additions & 4 deletions lib/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import os
import sys
from multiprocessing import Process

from lib.cli import cmd, colors, console, core, futil, rlinit

Expand All @@ -26,9 +25,6 @@ def main():

futil.write_file(text=f"{os.getpid()}", filepath=SESSION.pidfile)

update_job = Process(target=core.update,)
update_job.start()

while True:
try:
input_cmd = rlinit.prompt(session=SESSION)
Expand Down

0 comments on commit 9bed8a2

Please sign in to comment.