diff options
author | Roy Marples <roy@marples.name> | 2008-03-25 14:35:52 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-25 14:35:52 +0000 |
commit | 3d0fc150dcb3a26be482037bfa0d84f706e2ce1c (patch) | |
tree | c0c637df225ab10b592c8f28905cf32af1ccd7be | |
parent | fc7e6a3ada77ac047e166987e4c463b4b37804a6 (diff) |
Fix sysctl on Linux and BSD.
-rw-r--r-- | init.d/sysctl.in | 25 |
1 files 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" } |