Catch more sysctl comment patterns
This commit is contained in:
parent
28f5fe42c4
commit
ac67e36611
|
@ -163,30 +163,35 @@ function configure_internet_protocol {
|
|||
if ! grep -q "net.ipv4.conf.default.send_redirects" /etc/sysctl.conf; then
|
||||
echo "net.ipv4.conf.default.send_redirects = 0" >> /etc/sysctl.conf
|
||||
else
|
||||
sed -i "s|# net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|#net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
|
||||
fi
|
||||
if ! grep -q "net.ipv4.conf.all.secure_redirects" /etc/sysctl.conf; then
|
||||
echo "net.ipv4.conf.all.secure_redirects = 0" >> /etc/sysctl.conf
|
||||
else
|
||||
sed -i "s|# net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|#net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
|
||||
fi
|
||||
if ! grep -q "net.ipv4.conf.default.accept_source_route" /etc/sysctl.conf; then
|
||||
echo "net.ipv4.conf.default.accept_source_route = 0" >> /etc/sysctl.conf
|
||||
else
|
||||
sed -i "s|# net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|#net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
|
||||
fi
|
||||
if ! grep -q "net.ipv4.conf.default.secure_redirects" /etc/sysctl.conf; then
|
||||
echo "net.ipv4.conf.default.secure_redirects = 0" >> /etc/sysctl.conf
|
||||
else
|
||||
sed -i "s|# net.ipv4.conf.default.secure_redirects.*|net.ipv4.conf.default.secure_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|#net.ipv4.conf.default.secure_redirects.*|net.ipv4.conf.default.secure_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|net.ipv4.conf.default.secure_redirects.*|net.ipv4.conf.default.secure_redirects = 0|g" /etc/sysctl.conf
|
||||
fi
|
||||
if ! grep -q "net.ipv4.conf.default.accept_redirects" /etc/sysctl.conf; then
|
||||
echo "net.ipv4.conf.default.accept_redirects = 0" >> /etc/sysctl.conf
|
||||
else
|
||||
sed -i "s|# net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|#net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
|
||||
sed -i "s|net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue