* add synonyms for "yes": "true", "on", and "1"

* add synonyms for "no": "false", "off", and "0"
* remove unnecessary trailing semicolons (this is sh, not C)
This commit is contained in:
lukem 1998-02-28 22:54:02 +00:00
parent eb3cda883b
commit 79201de07b
1 changed files with 12 additions and 7 deletions

View File

@ -1,19 +1,24 @@
# $NetBSD: rc.subr,v 1.3 1998/01/26 04:36:26 lukem Exp $
# $NetBSD: rc.subr,v 1.4 1998/02/28 22:54:02 lukem Exp $
# functions used by various rc scripts
# Test $1 variable, and warn if not set to YES or NO.
checkyesno() {
eval value=\$${1};
eval value=\$${1}
case $value in
[Yy][Ee][Ss])
return 0;
# "yes", "true", "on", or "1"
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
return 0
;;
[Nn][Oo])
return 1;
# "no", "false", "off", or "0"
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
return 1
;;
*)
logger -s "WARNING: \$${1} is not set properly."
return 1;
return 1
;;
esac
}