diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2012-08-14 07:43:58 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2012-08-14 07:43:58 +0000 |
commit | 2016b9b991db2b995a0b19a011def9ea355f2fc2 (patch) | |
tree | 92608e50f732899d8372bbe51d0857169b18826e /etc/rc.d | |
parent | eb094586f97bed7fa160f759787e038ef9602ae9 (diff) |
Optimize checks for /etc/exports.
from robert at peichaer dot org
discussed with and ok halex@
Diffstat (limited to 'etc/rc.d')
-rw-r--r-- | etc/rc.d/mountd | 4 | ||||
-rw-r--r-- | etc/rc.d/nfsd | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/etc/rc.d/mountd b/etc/rc.d/mountd index fb1d7cfaf8d..e9dd3e61604 100644 --- a/etc/rc.d/mountd +++ b/etc/rc.d/mountd @@ -1,13 +1,13 @@ #!/bin/sh # -# $OpenBSD: mountd,v 1.2 2011/08/02 11:59:25 robert Exp $ +# $OpenBSD: mountd,v 1.3 2012/08/14 07:43:57 ajacoutot Exp $ daemon="/sbin/mountd" . /etc/rc.d/rc.subr rc_pre() { - [ -s /etc/exports -a `sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ] && + [ -s /etc/exports ] && grep -qv '^#' /etc/exports && \ rm -f /var/db/mountdtab && \ echo -n > /var/db/mountdtab } diff --git a/etc/rc.d/nfsd b/etc/rc.d/nfsd index 3911cb5a2c2..39476217049 100644 --- a/etc/rc.d/nfsd +++ b/etc/rc.d/nfsd @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: nfsd,v 1.4 2012/07/10 15:03:24 halex Exp $ +# $OpenBSD: nfsd,v 1.5 2012/08/14 07:43:57 ajacoutot Exp $ daemon="/sbin/nfsd" @@ -11,7 +11,7 @@ pexp="(${daemon}( |$)|nfsd: (master|server)$)" rc_reload=NO rc_pre() { - [ -s /etc/exports -a `sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ] + [ -s /etc/exports ] && grep -qv '^#' /etc/exports } rc_cmd $1 |