From 3d0fc150dcb3a26be482037bfa0d84f706e2ce1c Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Tue, 25 Mar 2008 14:35:52 +0000
Subject: Fix sysctl on Linux and BSD.

---
 init.d/sysctl.in | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/init.d/sysctl.in b/init.d/sysctl.in
index b1d8fb83..fdaf8ee2 100644
--- a/init.d/sysctl.in
+++ b/init.d/sysctl.in
@@ -9,11 +9,7 @@ depend()
 	keyword noprefix
 }
 
-start()
-{
-	[ -e /etc/sysctl.conf ] || return 0
-	
-	ebegin "Configuring kernel parameters"
+sysctl_BSD() {
 	local retval=0 var= comments=
 	while read var comments; do
 		case "${var}" in
@@ -21,6 +17,21 @@ start()
 		esac
 		sysctl -w "${var}" >/dev/null || retval=1
 	done < /etc/sysctl.conf
-	eend ${retval} "Some errors were encountered"
-	eend $?
+	return ${retval}
+}
+
+sysctl_Linux() {
+	sysctl -p >/dev/null
+}
+
+start()
+{
+	[ -e /etc/sysctl.conf ] || return 0
+	
+	ebegin "Configuring kernel parameters"
+	case "${RC_UNAME}" in
+		Linux)	sysctl_Linux;;
+		*)	sysctl_BSD;;
+	esac
+	eend $? "Some errors were encountered"
 }
-- 
cgit v1.2.3