summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-21 14:57:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-21 14:57:09 +0000
commitffd4336d54a33f7ff301b4410af3a8c141b06569 (patch)
tree4c1e520a706466aecdeafa86f6cca934624044f9
parent2e2c8e524b23267789030254155d4c1265827203 (diff)
downloadalpine-conf-ffd4336d54a33f7ff301b4410af3a8c141b06569.zip
libalpine: add yesno function
-rw-r--r--libalpine.sh.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in
index 684f950..edfeeb0 100644
--- a/libalpine.sh.in
+++ b/libalpine.sh.in
@@ -71,6 +71,14 @@ cfg_add() {
[ -z "$NOCOMMIT" ] && lbu_add "$@"
}
+# return true if given value is 1, Y, Yes, yes YES etc
+yesno() {
+ case $1 in
+ [Yy]|[Yy][Ee][Ss]|1|[Tt][Rr][Uu][Ee]) return 0;;
+ esac
+ return 1
+}
+
# Detect if we are running Xen
is_xen() {
test -d /proc/xen