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: Stefan Tomanek <stefan.tomanek+openwrt@wertarbyte.de> SVN-Revision: 46239
This commit is contained in:
parent
0e2d9769be
commit
3787c32183
4 changed files with 12 additions and 4 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#!/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 @@
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
1
package/base-files/files/etc/sysctl.d/local.conf
Normal file
1
package/base-files/files/etc/sysctl.d/local.conf
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# local sysctl settings can be stored in this directory
|
Loading…
Reference in a new issue