From 1d9ce8e9a1ece0fd108b2b50b45bc4a0da0cf3fc Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 10 Nov 2009 22:40:35 +0000 Subject: Allow sysctl to read confs from /etc/sysctl.d Fixes #203. --- init.d/sysctl.BSD.in | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'init.d/sysctl.BSD.in') diff --git a/init.d/sysctl.BSD.in b/init.d/sysctl.BSD.in index 22b364b2..eba9d4d6 100644 --- a/init.d/sysctl.BSD.in +++ b/init.d/sysctl.BSD.in @@ -12,13 +12,21 @@ depend() start() { [ -e /etc/sysctl.conf ] || return 0 - local retval=0 var= comments= + local retval=0 var= comments= conf= ebegin "Configuring kernel parameters" - while read var comments; do - case "$var" in - ""|"#"*) continue;; - esac - sysctl -w "$var" >/dev/null || retval=1 - done < /etc/sysctl.conf + eindent + for conf in /etc/sysctl.d/*.conf /etc/sysctl.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" } -- cgit v1.2.3