summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'init.d')
-rw-r--r--init.d/sysctl.in25
1 files changed, 18 insertions, 7 deletions
diff --git a/init.d/sysctl.in b/init.d/sysctl.in
index b1d8fb8..fdaf8ee 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"
}