summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-01-30 02:45:52 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-01-30 02:45:52 +0000
commitd291a1fc70102da39f165618d208f5e8cba86817 (patch)
treeacd0bc2e5e0acd87dc50e58b93c804bb6312c25f
parent5068f7a44621b27f5d2b508012acfdc5b2d3278e (diff)
Use ed, not sed, for pulling the interesting bits out of /etc/sysctl.conf.
-rw-r--r--etc/rc13
1 files changed, 10 insertions, 3 deletions
diff --git a/etc/rc b/etc/rc
index 6f922ecca85..016991bb324 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.128 2000/01/30 02:17:00 mickey Exp $
+# $OpenBSD: rc,v 1.129 2000/01/30 02:45:51 millert Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -108,10 +108,17 @@ fi
if [ -f /etc/sysctl.conf ]; then
(
# delete comments and blank lines
- set -- `sed -e 's/#.*$//' -e '/^$/d' /etc/sysctl.conf`
+ # we use ed here because /usr may not be mounted yet.
+ set -- `
+ ed -s /etc/sysctl.conf <<EOF
+1,\\\$s/#.*$//
+g/^..*/p
+Q
+EOF
+`
while [ $# -ge 1 ] ; do
sysctl -w $1
- shift 1
+ shift
done
)
fi