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.
This commit is contained in:
parent
3c2498c0d3
commit
9d182321ce
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user