Add a support for a ${OSTYPE} which is set once in /etc/rc.subr. Also convert

all instances of `${CMD_OSTYPE}` to just using ${OSTYPE}. This saves us a
shell invocation on anything that is OS-dependent. I seriously doubt that we
will be spontaneously changing OS types during bootup.
This commit is contained in:
Gordon Tetlow 2002-09-06 16:15:29 +00:00
parent fbabd7bec2
commit 550f8fc46b

View File

@ -46,8 +46,9 @@
SYSCTL="/sbin/sysctl"
SYSCTL_N="${SYSCTL} -n"
CMD_OSTYPE="${SYSCTL_N} kern.ostype"
OSTYPE=`${CMD_OSTYPE}`
case `${CMD_OSTYPE}` in
case ${OSTYPE} in
FreeBSD)
SYSCTL_W="${SYSCTL}"
;;
@ -78,7 +79,7 @@ set_rcvar()
base_var="$1"
fi
case `${CMD_OSTYPE}` in
case ${OSTYPE} in
FreeBSD)
echo ${base_var}_enable
;;
@ -817,7 +818,7 @@ load_rc_config()
# XXX - Deprecated variable name support
#
case `${CMD_OSTYPE}` in
case ${OSTYPE} in
FreeBSD)
[ -n "$portmap_enable" ] && rpcbind_enable="$portmap_enable"
[ -n "$portmap_program" ] && rpcbind_program="$portmap_program"