From 390d72be15b0b886ecec8a4ce9879fadaa97f9a9 Mon Sep 17 00:00:00 2001 From: gordon Date: Fri, 6 Sep 2002 16:15:29 +0000 Subject: 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. --- etc/rc.subr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/rc.subr b/etc/rc.subr index d2b178d..c170649 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -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" -- cgit v1.1