diff options
Diffstat (limited to 'sys-freebsd/freebsd-sbin/files/sysctl.initd')
-rw-r--r-- | sys-freebsd/freebsd-sbin/files/sysctl.initd | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-sbin/files/sysctl.initd b/sys-freebsd/freebsd-sbin/files/sysctl.initd new file mode 100644 index 0000000..9b8aaf8 --- /dev/null +++ b/sys-freebsd/freebsd-sbin/files/sysctl.initd @@ -0,0 +1,28 @@ +#!/sbin/openrc-run +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + after checkroot root +} + +start() { + ebegin "Configuring kernel parameters" + + if [ ! -f /etc/sysctl.conf ]; then + eend 1 "/etc/sysctl.conf" "not found" + return 1 + fi + + local retval=0 var= comments= + while read var comments ; do + case "${var}" in + ""|"#"*) continue;; + esac + sysctl "${var}" >/dev/null || retval=1 + done < /etc/sysctl.conf + eend ${retval} "Some errors were encountered" +} + +# vim: set ts=4 : |