29 lines
539 B
Plaintext
29 lines
539 B
Plaintext
# $NetBSD: rc.subr,v 1.5 1998/02/28 22:56:11 lukem Exp $
|
|
# functions used by various rc scripts
|
|
|
|
#
|
|
# checkyesno
|
|
# Test $1 variable, and warn if not set to YES or NO.
|
|
# return 0 if it's "yes" (et al), nonzero otherwise
|
|
#
|
|
checkyesno() {
|
|
eval value=\$${1}
|
|
case $value in
|
|
|
|
# "yes", "true", "on", or "1"
|
|
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
|
|
return 0
|
|
;;
|
|
|
|
# "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
|
|
;;
|
|
esac
|
|
}
|