diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common-functions.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/common-functions.sh b/lib/common-functions.sh index 7435411e..0b1eb7d2 100644 --- a/lib/common-functions.sh +++ b/lib/common-functions.sh @@ -544,3 +544,19 @@ iptables -A FORWARD -s ${external_cidr} -m state --state ESTABLISHED,RELATED -j service iptables save EOI } + +# Interactive prompt handler +# params: step stage, ex. deploy, undercloud install, etc +function prompt_user { + while [ 1 ]; do + echo -n "Would you like to proceed with ${1}? (y/n) " + read response + if [ "$response" == 'y' ]; then + return 0 + elif [ "$response" == 'n' ]; then + return 1 + else + continue + fi + done +} |