Nicer output formatting and early abort when the autopilot limit is reached.

This commit is contained in:
Manuel Friedli 2020-07-23 21:36:50 +02:00
parent 4ef0b60ed1
commit 771531167c
1 changed files with 10 additions and 4 deletions

View File

@ -317,16 +317,22 @@ Found '${blue}${addr}${reset}' ${hilite}${count}${reset} times."
echo -en "Ban [y/N/s=No, and skip remaining]? "
read banaction
else
echo -en "\n${red}Autopilot active.${reset} "
if [[ ${country_cn} -eq 0 && ${source_apnic} -eq 0 ]] ; then
if [[ $count -ge $autopilot ]] ; then
echo -en "\n${red}Autopilot active. ${reset}"
banaction=y
else
echo -en "${yellow}Ignoring because count ${count} is below specified limit of ${autopilot}.${reset} "
banaction=n
echo -e "\n${yellow}Autopilot active. Ignoring remaining addresses due to limit of ${autopilot}.${reset}"
return
fi
else
banaction=n
if [[ $count -ge $autopilot ]] ; then
echo -en "\n${green}Autopilot active. ${reset}"
banaction=n
else
echo -e "\n${green}Autopilot active.${reset} ${yellow}Ignoring remaining addresses due to limit of ${autopilot}.${reset}"
return
fi
fi
fi