Fixed restoration bug choice.

This commit is contained in:
Matias Barcenas 2018-04-23 00:18:12 -05:00
parent e31beafcbc
commit d41dd05829
1 changed files with 5 additions and 1 deletions

View File

@ -455,6 +455,10 @@ fluxion_handle_target_change() {
fluxion_conditional_bail "Target tracker failed to stop attack." fluxion_conditional_bail "Target tracker failed to stop attack."
fi fi
if ! unprep_attack; then
fluxion_conditional_bail "Target tracker failed to unprep attack."
fi
if ! load_attack "$FLUXIONPath/attacks/$FluxionAttack/attack.conf"; then if ! load_attack "$FLUXIONPath/attacks/$FluxionAttack/attack.conf"; then
fluxion_conditional_bail "Target tracker failed to load attack." fluxion_conditional_bail "Target tracker failed to load attack."
fi fi
@ -1764,7 +1768,7 @@ fluxion_prep_attack() {
if type -t load_attack &> /dev/null; then if type -t load_attack &> /dev/null; then
# If configuration file available, check if user wants to restore. # If configuration file available, check if user wants to restore.
if [ -f "$path/attack.conf" ]; then if [ -f "$path/attack.conf" ]; then
local choice=${1:+Y} local choice="?"
# TODO: This doesn't translate choices to the selected language. # TODO: This doesn't translate choices to the selected language.
while ! echo "$choice" | grep -q "^[ynYN]$" &> /dev/null; do while ! echo "$choice" | grep -q "^[ynYN]$" &> /dev/null; do
echo -ne "$FLUXIONVLine Would you like to repeat the last attack? [Y/n] " echo -ne "$FLUXIONVLine Would you like to repeat the last attack? [Y/n] "