Skip to content

Add environment variable for location of wordlist #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions genhost
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# genhost - generate unused hostnames by randomly picking from a word list
#

readonly wordlist='wordlist'
readonly wordlist=${GENHOST_WORDLIST:-$(dirname $0)/wordlist}
readonly domain=${GENHOST_DOMAIN:-example.com}

# http://mywiki.wooledge.org/BashFAQ/026
Expand Down Expand Up @@ -75,7 +75,7 @@ else
;;
esac
elif [[ $1 == "list" ]]; then
grep "#" wordlist | sed 's/#//'
grep "#" ${wordlist} | sed 's/#//'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you quote this variable to prevent word splitting?

else
printf 'genhost: invalid input\n' >&2
exit 1
Expand Down