Files
lxcafe/post_installation_script/common.sh
T

17 lines
413 B
Bash
Executable File

# functions and variables for use in multiple files ("common" functions and variables)
question_answered_with_yes() {
local prompt="$1"
local ans
printf '%b\n Geben Sie j oder n ein und die Eingabetaste,\n Abbruch mit jeder anderen Taste ... [j/N]: ' "$prompt"
read -r ans
case "$ans" in
j | J | ja | y | Y) return 0 ;;
n | N | "") return 1 ;;
*)
echo "Abbruch."
exit 1
;;
esac
}