own-pki/lib/yes-no.sh-old
2026-04-26 20:44:39 +02:00

14 lines
331 B
Plaintext

# check if run from script
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && exit 1
yes_no(){
if [ "$ASSUME_YES" == "0" ]; then
echo -n -e "${CYAN}$1 [y/N]? ${NC}"
unset answer
read answer
if [ "${answer}" != "y" ]; then
echo -e "${ORANGE}Canceled!${NC}"
exit 1
fi
fi
}