Support /etc/sysctl.d

When searching for sysctl settings to reapply at start/restart, search
in all files in /etc/sysctl.d/ instead of just in /etc/sysctl.conf.
This commit is contained in:
Phil Sutter 2018-02-28 08:34:22 +01:00
parent 948527f3fe
commit 85aff8c513

View File

@ -150,7 +150,7 @@ load_sysctl() {
echo -n $"Loading sysctl settings: " echo -n $"Loading sysctl settings: "
ret=0 ret=0
for item in $IPTABLES_SYSCTL_LOAD_LIST; do for item in $IPTABLES_SYSCTL_LOAD_LIST; do
fgrep $item /etc/sysctl.conf | sysctl -p - >/dev/null fgrep -hs $item /etc/sysctl.d/* | sysctl -p - >/dev/null
let ret+=$?; let ret+=$?;
done done
[ $ret -eq 0 ] && success || failure [ $ret -eq 0 ] && success || failure