diff options
author | gordon <gordon@FreeBSD.org> | 2002-09-06 16:15:29 +0000 |
---|---|---|
committer | gordon <gordon@FreeBSD.org> | 2002-09-06 16:15:29 +0000 |
commit | 390d72be15b0b886ecec8a4ce9879fadaa97f9a9 (patch) | |
tree | 2fa37bebbdc978a343a268c1796f80d4d94c2c2b /etc/rc.subr | |
parent | 3796a7b1aa46f822593bcc6df530172e9dc72fef (diff) | |
download | FreeBSD-src-390d72be15b0b886ecec8a4ce9879fadaa97f9a9.zip FreeBSD-src-390d72be15b0b886ecec8a4ce9879fadaa97f9a9.tar.gz |
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.
Diffstat (limited to 'etc/rc.subr')
-rw-r--r-- | etc/rc.subr | 7 |
1 files 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" |