Skip to content

Commit

Permalink
bug fix thanks jarrrreeddddddd
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustedSec committed Aug 6, 2018
1 parent a6845e3 commit 1f77cfa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
6 changes: 6 additions & 0 deletions readme/CHANGELOG
@@ -1,3 +1,9 @@
~~~~~~~~~~~~~~~~~
version 2.1.3
~~~~~~~~~~~~~~~~~

* fix bug that caused update only installed to fail with prompt not defined

~~~~~~~~~~~~~~~~~
version 2.1.2
~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion src/core.py
Expand Up @@ -110,7 +110,7 @@ def count_modules():
return counter

# version information
grab_version = "2.1.2"
grab_version = "2.1.3"

# banner
banner = bcolors.RED + r"""
Expand Down
44 changes: 17 additions & 27 deletions src/framework.py
Expand Up @@ -19,19 +19,16 @@

# funny random banner
import random
funny = random.sample(["Aliens", "Clowns", "Mr. Robot",
"Zero Cool", "Goats", "Hackers", "Unicorns"], 1)[0]
funny = random.sample(["Aliens", "Clowns", "Mr. Robot","Zero Cool", "Goats", "Hackers", "Unicorns"], 1)[0]

# blank variables used later
deb_modules = ""
arch_modules = ""
fedora_modules = ""
openbsd_modules = ""

if check_kali() == "Kali":
os_profile = "Kali"
else:
os_profile = profile_os()
if check_kali() == "Kali": os_profile = "Kali"
else: os_profile = profile_os()


print_status("Operating system detected as: " + bcolors.BOLD + os_profile + bcolors.ENDC)
Expand Down Expand Up @@ -174,6 +171,7 @@ def show_new_modules():

# this is when a use <module> command is initiated
def use_module(module, all_trigger):
prompt = ("")
# if we aren't using all
if not "install_update_all" in module and not "update_installed" in module and not "__init__" in module:

Expand Down Expand Up @@ -201,8 +199,7 @@ def use_module(module, all_trigger):
tool_depend = module_parser(filename, "TOOL_DEPEND")
# if the module path is wrong, throw a warning
if not os.path.isfile(tool_depend + ".py"):
if len(tool_depend) > 1:
print_warning("Tool depend: " + tool_depend + " not found. Ensure the module is pointing to a module location.")
if len(tool_depend) > 1: print_warning("Tool depend: " + tool_depend + " not found. Ensure the module is pointing to a module location.")

# grab repository location
repository_location = module_parser(filename, "REPOSITORY_LOCATION")
Expand Down Expand Up @@ -312,14 +309,13 @@ def use_module(module, all_trigger):
use_module(tool_depend, "1")
except: pass

if len(tool_depend) < 1:
if int(all_trigger) == 1:
prompt = "run"

#moomoo
if prompt != "":
if int(all_trigger) == 1:
prompt = "run"

if int(all_trigger) == 2:
prompt = "update"
if int(all_trigger) == 2:
print "IM HERE"
prompt = "update"

# if we are using run, check first to see if its there, if so, do
# an upgrade
Expand Down Expand Up @@ -371,16 +367,13 @@ def use_module(module, all_trigger):
after_commands(filename, install_location)

if install_type.lower() == "svn":
print_status(
"Updating the tool, be patient while svn pull is initiated.")
proc = subprocess.Popen("cd %s;svn update" % (
install_location), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
print_status("Updating the tool, be patient while svn pull is initiated.")
proc = subprocess.Popen("cd %s;svn update" % (install_location), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
# here we do some funky stuff to store old
# revisions
try:
if not os.path.isfile(install_location + "/.goatsvn_storage"):
filewrite = open(
install_location + "/.goatsvn_storage", "w")
filewrite = open(install_location + "/.goatsvn_storage", "w")
filewrite.write(proc.communicate()[0])
filewrite.close()

Expand All @@ -394,21 +387,18 @@ def use_module(module, all_trigger):
prompt = "goat"
except:
pass
print_status(
"Finished Installing! Enjoy the tool installed under: " + (install_location))
print_status("Finished Installing! Enjoy the tool installed under: " + (install_location))
# check launcher
launcher(filename, install_location)

# run after commands
if prompt != "update":
after_commands(filename, install_location)
if prompt != "update": after_commands(filename, install_location)

print_status("Running updatedb to tidy everything up.")
subprocess.Popen("updatedb", shell=True).wait()

if not os.path.isdir(install_location):
print_error(
"The tool was not found in the install location. Try running install first!")
print_error("The tool was not found in the install location. Try running install first!")

# if we want to install it
if prompt.lower() == "install":
Expand Down

0 comments on commit 1f77cfa

Please sign in to comment.