Commit fecca189 authored by Janek Bevendorff's avatar Janek Bevendorff

Bail after 10 unsuccessful tries

parent b1205673
...@@ -129,11 +129,18 @@ choose_root_cert() { ...@@ -129,11 +129,18 @@ choose_root_cert() {
echo -en "\nYour choice: " >&2 echo -en "\nYour choice: " >&2
read root_cert_choice read root_cert_choice
while [ "${root_certs[$root_cert_choice]}" == "" ]; do local choice_counter=0
while [ $choice_counter -lt 10 ] && [ "${root_certs[$root_cert_choice]}" == "" ]; do
logError "Invalid choice, please enter a valid number." logError "Invalid choice, please enter a valid number."
echo -en "\nYour choice: " >&2 echo -en "\nYour choice: " >&2
read root_cert_choice read root_cert_choice
choice_counter=$((choice_counter + 1))
done done
if [ $choice_counter -ge 10 ]; then
logError "Too many failures."
cleanup "$1"
exit 1
fi
echo "${root_certs[$root_cert_choice]}" echo "${root_certs[$root_cert_choice]}"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment