NetBSD/etc/rc.subr
lukem 6b18196f4c convert 'if .. else .. fi' into a 'case .. esac', and allow for any
uppercase/lowercase variations of 'yes' and 'no'. fixes [misc/4887]
sent in by "John F. Woods" <jfw@jfwhome.funhouse.com>
1998-01-26 04:36:26 +00:00

20 lines
342 B
Plaintext

# $NetBSD: rc.subr,v 1.3 1998/01/26 04:36:26 lukem Exp $
# functions used by various rc scripts
# Test $1 variable, and warn if not set to YES or NO.
checkyesno() {
eval value=\$${1};
case $value in
[Yy][Ee][Ss])
return 0;
;;
[Nn][Oo])
return 1;
;;
*)
logger -s "WARNING: \$${1} is not set properly."
return 1;
;;
esac
}