mirror of
https://codeberg.org/knightsub9/lxcafe.git
synced 2026-07-19 19:30:16 +02:00
seperate function question_answered_with_yes from /post_installation_script/Nachinstallationsarbeiten_LC_Esslingen.sh
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
# 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
|
||||
}
|
||||
Reference in New Issue
Block a user