diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-21 14:57:09 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-21 14:57:09 +0000 |
commit | ffd4336d54a33f7ff301b4410af3a8c141b06569 (patch) | |
tree | 4c1e520a706466aecdeafa86f6cca934624044f9 | |
parent | 2e2c8e524b23267789030254155d4c1265827203 (diff) | |
download | alpine-conf-ffd4336d54a33f7ff301b4410af3a8c141b06569.zip |
libalpine: add yesno function
-rw-r--r-- | libalpine.sh.in | 8 |
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 |