Skip to content
Snippets Groups Projects
Commit 16cf260b authored by blogic's avatar blogic
Browse files

sysctl: read settings from /etc/sysctl.d/*.conf


This changes makes it possible to store custom settings
in individual files inside the directory /etc/sysctl.d/.

Signed-off-by: default avatarStefan Tomanek <stefan.tomanek+openwrt@wertarbyte.de>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46239 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent ec9c7cd4
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,8 @@ define Package/base-files/conffiles ...@@ -55,6 +55,8 @@ define Package/base-files/conffiles
/etc/config/ /etc/config/
/etc/dropbear/ /etc/dropbear/
/etc/crontabs/ /etc/crontabs/
/etc/sysctl.d/local.conf
/etc/sysctl.d/
$(call $(TARGET)/conffiles) $(call $(TARGET)/conffiles)
endef endef
......
#!/bin/sh #!/bin/sh
if [ -f /etc/sysctl.conf ] && [ "$ACTION" = add ]; then if [ "$ACTION" = add ]; then
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" /etc/sysctl.conf | \ for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
sysctl -e -p - | logger -t sysctl [ ! -f "$CONF" ] && continue;
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
sysctl -e -p - | logger -t sysctl
done
fi fi
...@@ -3,5 +3,7 @@ ...@@ -3,5 +3,7 @@
START=11 START=11
start() { 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
} }
# local sysctl settings can be stored in this directory
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment