openrc/init.d/sysctl.BSD.in

25 lines
528 B
Plaintext
Raw Normal View History

#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
2007-11-20 12:10:32 +00:00
depend()
{
2007-11-20 12:10:32 +00:00
use hostname
before bootmisc logger
2008-03-02 21:13:21 +00:00
keyword noprefix
2007-11-20 12:10:32 +00:00
}
start()
{
[ -e /etc/sysctl.conf ] || return 0
2007-11-20 12:10:32 +00:00
local retval=0 var= comments=
ebegin "Configuring kernel parameters"
2007-11-28 15:45:03 +00:00
while read var comments; do
2007-11-20 12:10:32 +00:00
case "${var}" in
""|"#"*) continue;;
esac
2008-01-10 23:48:53 +00:00
sysctl -w "${var}" >/dev/null || retval=1
2007-11-20 12:10:32 +00:00
done < /etc/sysctl.conf
eend ${retval} "Some errors were encountered"
2007-11-20 12:10:32 +00:00
}