Skip to content

Commit

Permalink
v0.1.1b
Browse files Browse the repository at this point in the history
[Added] Removing the temporary directory before starting discovery process and upon exiting
  • Loading branch information
foozzi committed Oct 25, 2023
1 parent 9e654bd commit e700d03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion discoshell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# You can also find the source code of this script and collaborate on GitHub:
# Repository: https://github.com/foozzi/discoshell
#
VERSION="0.1.0b"
VERSION="0.1.1b"

# bash settings
trap cleanup INT
Expand All @@ -45,6 +45,8 @@ if [[ -n "$BATS_ENVIRONMENT" ]]; then # tests
discoshell_results="$BATS_TEST_DIR"
else
discoshell_results=.discoshell_results
# before discovering, make sure that '~/.discoshell_results' is deleted
rm -rf "$discoshell_results"
fi
subfinder_output=subfinder.txt
amass_output=amass.txt
Expand Down Expand Up @@ -81,13 +83,16 @@ function die() {
set_text_color 1
echo "Script failed: $1, exiting..."
reset_text_format
# deleting '~/.discoshell_results' after encountering an error
rm -rf "$discoshell_results"
exit 1
}

function cleanup() {
set_text_color 1
echo "exiting..."
# deleting '~/.discoshell_results' upon exiting [^C]
rm -rf "$discoshell_results"
reset_text_format
exit 0
}
Expand Down

0 comments on commit e700d03

Please sign in to comment.