Fixed a bug caused by missing sites directory.

This commit is contained in:
Matias Barcenas 2017-08-18 18:21:24 -05:00
parent cf1ff976ac
commit d03f65617c
1 changed files with 17 additions and 10 deletions

View File

@ -135,17 +135,24 @@ function captive_portal_set_site() {
captive_portal_unset_site captive_portal_unset_site
local sites local sites=()
# Retrieve all available portal sites and # Attempt adding only if the directory exists.
# store them without the .portal extension. if [ -d attacks/Captive\ Portal/sites/generic ]; then
for site in attacks/Captive\ Portal/sites/generic/* attacks/Captive\ Portal/sites/*.portal; do # Retrieve all generic sites available.
site="${site/attacks\/Captive\ Portal\/sites\//}" for site in attacks/Captive\ Portal/sites/generic/*; do
if [[ "$site" != *.portal ]]; then sites+=("${CaptivePortalGenericInterfaceOption}_`basename "$site"`")
site="${CaptivePortalGenericInterfaceOption}_${site/generic\//}" done
fi fi
sites[${#sites[@]}]="${site/.portal/}"
done # Attempt adding only if the directory exists.
if [ -d attacks/Captive\ Portal/sites ]; then
# Retrieve all available portal sites and
# store them without the .portal extension.
for site in attacks/Captive\ Portal/sites/*.portal; do
sites+=("`basename "${site/.portal/}"`")
done
fi
local sitesIdentifier=("${sites[@]/_*/}" "$FLUXIONGeneralBackOption") local sitesIdentifier=("${sites[@]/_*/}" "$FLUXIONGeneralBackOption")
local sitesLanguage=("${sites[@]/*_/}") local sitesLanguage=("${sites[@]/*_/}")