|
@ -271,25 +271,25 @@ fn_print_information_nl(){ |
|
|
|
|
|
|
|
|
# Y/N Prompt |
|
|
# Y/N Prompt |
|
|
fn_prompt_yn(){ |
|
|
fn_prompt_yn(){ |
|
|
local prompt="$1" |
|
|
local prompt="$1" |
|
|
local initial="$2" |
|
|
local initial="$2" |
|
|
|
|
|
|
|
|
if [ "${initial}" == "Y" ]; then |
|
|
if [ "${initial}" == "Y" ]; then |
|
|
prompt+=" [Y/n] " |
|
|
prompt+=" [Y/n] " |
|
|
elif [ "${initial}" == "N" ]; then |
|
|
elif [ "${initial}" == "N" ]; then |
|
|
prompt+=" [y/N] " |
|
|
prompt+=" [y/N] " |
|
|
else |
|
|
else |
|
|
prompt+=" [y/n] " |
|
|
prompt+=" [y/n] " |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
while true; do |
|
|
while true; do |
|
|
read -e -i "${initial}" -p "${prompt}" -r yn |
|
|
read -e -i "${initial}" -p "${prompt}" -r yn |
|
|
case "${yn}" in |
|
|
case "${yn}" in |
|
|
[Yy]|[Yy][Ee][Ss]) return 0 ;; |
|
|
[Yy]|[Yy][Ee][Ss]) return 0 ;; |
|
|
[Nn]|[Nn][Oo]) return 1 ;; |
|
|
[Nn]|[Nn][Oo]) return 1 ;; |
|
|
*) echo "Please answer yes or no." ;; |
|
|
*) echo "Please answer yes or no." ;; |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# On-Screen End of Line |
|
|
# On-Screen End of Line |
|
|