summaryrefslogtreecommitdiffstats
path: root/etc/rc.sysctl
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2000-08-09 02:03:30 +0000
committerchris <chris@FreeBSD.org>2000-08-09 02:03:30 +0000
commitecf1cd2d1ce96875d4d7506f923cd86cf755257e (patch)
tree23b2fa12b4a7e1113bb312107384a4d3fdcfc30c /etc/rc.sysctl
parent31d32eb7b17096bc631f7f00b1420754eac118b9 (diff)
downloadFreeBSD-src-ecf1cd2d1ce96875d4d7506f923cd86cf755257e.zip
FreeBSD-src-ecf1cd2d1ce96875d4d7506f923cd86cf755257e.tar.gz
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.
Diffstat (limited to 'etc/rc.sysctl')
-rw-r--r--etc/rc.sysctl18
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/rc.sysctl b/etc/rc.sysctl
index 1a5c48e..7a852a3 100644
--- a/etc/rc.sysctl
+++ b/etc/rc.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
OpenPOWER on IntegriCloud