diff --git a/etc/rc.subr b/etc/rc.subr index 97412f9713f1..066d99b4f6ff 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -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 }