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

2015-05-27 Thread Stefan Tomanek
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+open...@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@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-27 Thread Jonathan Thibault
You might want to adjust the hotplug script too.

On 27/05/15 05:23 AM, Stefan Tomanek wrote:
 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+open...@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
  }
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel