[OpenWrt-Devel] [PATCH] sysctl: read settings from /etc/sysctl.d/*.conf

Stefan Tomanek stefan.tomanek+openwrt at wertarbyte.de
Wed May 27 05:23:17 EDT 2015


This changes makes it possible to store custom settings
in individual files inside the directory /etc/sysctl.d/,
which take precedence over /etc/sysctl.conf.

Signed-off-by: Stefan Tomanek <stefan.tomanek+openwrt at wertarbyte.de>
---
 package/base-files/files/etc/init.d/sysctl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl
index 36e29ea..2dfbaf7 100755
--- a/package/base-files/files/etc/init.d/sysctl
+++ b/package/base-files/files/etc/init.d/sysctl
@@ -3,5 +3,7 @@
 
 START=11
 start() {
-	[ -f /etc/sysctl.conf ] && sysctl -p -e >&-
+	for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
+		[ -f "$CONF" ] && sysctl -p "$CONF" -e >&-
+	done
 }
-- 
1.7.2.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list