2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

When go-xcat prompts the user to continue, prompt until y or n

is specified before aborting.
This commit is contained in:
Victor Hu 2017-06-05 14:09:37 -04:00
parent f4052275d0
commit b7f8af5e34

View File

@ -1567,14 +1567,22 @@ case "${GO_XCAT_ACTION}" in
then
echo
echo "xCAT is going to be ${GO_XCAT_ACTION/%e/}ed."
read -r -p "Continue? [y/n] "
case "${REPLY}" in
"Y"*|"y"*)
;;
*)
echo "Aborting ..."
exit 0
esac
while true; do
read -r -p "Continue? [y/n] "
case "${REPLY}" in
"Y"*|"y"*)
break
;;
"N"*|"n"*)
echo "Good-bye!"
exit 0
;;
*)
echo "Invalid response!"
;;
esac
done
fi
# Use `-y' here. Since the STDOUT is redirect to tee.
# `yum' does not display the prompt message properly when