diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-30 02:45:52 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-30 02:45:52 +0000 |
commit | d291a1fc70102da39f165618d208f5e8cba86817 (patch) | |
tree | acd0bc2e5e0acd87dc50e58b93c804bb6312c25f | |
parent | 5068f7a44621b27f5d2b508012acfdc5b2d3278e (diff) |
Use ed, not sed, for pulling the interesting bits out of /etc/sysctl.conf.
-rw-r--r-- | etc/rc | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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 |