diff options
author | Chris Costello <chris@FreeBSD.org> | 2000-08-09 02:03:30 +0000 |
---|---|---|
committer | Chris Costello <chris@FreeBSD.org> | 2000-08-09 02:03:30 +0000 |
commit | 9d182321ce77a40e4afd7f376c52955c0cc0f995 (patch) | |
tree | aaf716d3d8d013962f851ab1e1f47bc1d17f568e /etc/rc.d/sysctl | |
parent | 3c2498c0d3fc38e6bfc12e28c5e06f1860d87d17 (diff) | |
download | src-9d182321ce77a40e4afd7f376c52955c0cc0f995.tar.gz src-9d182321ce77a40e4afd7f376c52955c0cc0f995.zip |
Use shell matching instead of sed(1) to strip comments and blank lines.
Since it doesn't depend on anything in /usr, it should work with a NFS-mounted
/usr partition.
Thanks to Bruce Evans to bringing this to my attention.
Notes
Notes:
svn path=/head/; revision=64446
Diffstat (limited to 'etc/rc.d/sysctl')
-rw-r--r-- | etc/rc.d/sysctl | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl index 1a5c48eff461..7a852a3c2e80 100644 --- a/etc/rc.d/sysctl +++ b/etc/rc.d/sysctl @@ -3,14 +3,16 @@ # Read in /etc/sysctl.conf and set things accordingly # # $FreeBSD$ + if [ -f /etc/sysctl.conf ]; then - sed ' - /^[ ]*#/d - /^[ ]*$/d - s/#.*$//g - ' /etc/sysctl.conf | - while read var + while read var comments do - sysctl -w ${var} - done + case ${var} in + \#*|'') + ;; + *) + sysctl -w ${var} + ;; + esac + done < /etc/sysctl.conf fi |