aboutsummaryrefslogtreecommitdiff
path: root/init.d/sysctl.GNU-kFreeBSD.in
diff options
context:
space:
mode:
authorGabriele Giacone <1o5g4r8o@gmail.com>2014-10-21 02:24:12 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2014-10-22 11:09:58 -0500
commitd8e1d9a6edf94ecac580e80e1113f4fdbdc5a23b (patch)
tree038cfcd9eeafb5b5899db8088280f6a071ad0e63 /init.d/sysctl.GNU-kFreeBSD.in
parent3f82edbeb9251149c6aff071d6537379af4e5eea (diff)
Add missing files for GNU/kFreeBSD
Diffstat (limited to 'init.d/sysctl.GNU-kFreeBSD.in')
-rw-r--r--init.d/sysctl.GNU-kFreeBSD.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/init.d/sysctl.GNU-kFreeBSD.in b/init.d/sysctl.GNU-kFreeBSD.in
new file mode 100644
index 00000000..92d58680
--- /dev/null
+++ b/init.d/sysctl.GNU-kFreeBSD.in
@@ -0,0 +1,31 @@
+#!@SBINDIR@/openrc-run
+# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
+# Released under the 2-clause BSD license.
+
+depend()
+{
+ before bootmisc logger
+ keyword -prefix
+}
+
+start()
+{
+ [ -e /etc/sysctl.conf ] || return 0
+ local retval=0 var= comments= conf=
+ ebegin "Configuring kernel parameters"
+ eindent
+ for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
+ if [ -r "$conf" ]; then
+ vebegin "applying $conf"
+ while read var comments; do
+ case "$var" in
+ ""|"#"*) continue;;
+ esac
+ sysctl -w "$var" >/dev/null || retval=1
+ done < "$conf"
+ veend $retval
+ fi
+ done
+ eoutdent
+ eend $retval "Some errors were encountered"
+}