rc.subr revision 1.4
1#	$NetBSD: rc.subr,v 1.4 1998/02/28 22:54:02 lukem Exp $
2# functions used by various rc scripts
3
4# Test $1 variable, and warn if not set to YES or NO.
5checkyesno() {
6	eval value=\$${1}
7	case $value in
8
9		#	"yes", "true", "on", or "1"
10	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
11		return 0
12		;;
13
14		#	"no", "false", "off", or "0"
15	[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
16		return 1
17		;;
18
19	*)
20		logger -s "WARNING: \$${1} is not set properly."
21		return 1
22		;;
23	esac
24}
25