blob: 9b28ab06ce038ab04e67b1a5b4df9f492bffe5b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sbin/files/sysctl.initd,v 1.2 2006/04/12 16:07:48 flameeyes Exp $
start() {
ebegin "Setting sysctl variables"
success=0
if [ -f /etc/sysctl.conf ]; then
grep -v '^#' /etc/sysctl.conf | while read var comments
do
if [[ -n ${var} ]]; then
name="${var%%=*}"
val="${var#*=}"
if [[ $(sysctl -N ${name} 2>/dev/null) == ${name} ]]; then
sysctl ${name}=${val} &>/dev/null
else
eerror "Kernel doesn't like ${name}"
success=1
fi
fi
done
else
eerror "No /etc/sysctl.conf found."
success=1
fi
eend $success "Some errors were encountered"
}
|