|
@@ -163,30 +163,35 @@ function configure_internet_protocol {
|
163
|
163
|
if ! grep -q "net.ipv4.conf.default.send_redirects" /etc/sysctl.conf; then
|
164
|
164
|
echo "net.ipv4.conf.default.send_redirects = 0" >> /etc/sysctl.conf
|
165
|
165
|
else
|
|
166
|
+ sed -i "s|# net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
|
166
|
167
|
sed -i "s|#net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
|
167
|
168
|
sed -i "s|net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
|
168
|
169
|
fi
|
169
|
170
|
if ! grep -q "net.ipv4.conf.all.secure_redirects" /etc/sysctl.conf; then
|
170
|
171
|
echo "net.ipv4.conf.all.secure_redirects = 0" >> /etc/sysctl.conf
|
171
|
172
|
else
|
|
173
|
+ sed -i "s|# net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
|
172
|
174
|
sed -i "s|#net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
|
173
|
175
|
sed -i "s|net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
|
174
|
176
|
fi
|
175
|
177
|
if ! grep -q "net.ipv4.conf.default.accept_source_route" /etc/sysctl.conf; then
|
176
|
178
|
echo "net.ipv4.conf.default.accept_source_route = 0" >> /etc/sysctl.conf
|
177
|
179
|
else
|
|
180
|
+ sed -i "s|# net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
|
178
|
181
|
sed -i "s|#net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
|
179
|
182
|
sed -i "s|net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
|
180
|
183
|
fi
|
181
|
184
|
if ! grep -q "net.ipv4.conf.default.secure_redirects" /etc/sysctl.conf; then
|
182
|
185
|
echo "net.ipv4.conf.default.secure_redirects = 0" >> /etc/sysctl.conf
|
183
|
186
|
else
|
|
187
|
+ sed -i "s|# net.ipv4.conf.default.secure_redirects.*|net.ipv4.conf.default.secure_redirects = 0|g" /etc/sysctl.conf
|
184
|
188
|
sed -i "s|#net.ipv4.conf.default.secure_redirects.*|net.ipv4.conf.default.secure_redirects = 0|g" /etc/sysctl.conf
|
185
|
189
|
sed -i "s|net.ipv4.conf.default.secure_redirects.*|net.ipv4.conf.default.secure_redirects = 0|g" /etc/sysctl.conf
|
186
|
190
|
fi
|
187
|
191
|
if ! grep -q "net.ipv4.conf.default.accept_redirects" /etc/sysctl.conf; then
|
188
|
192
|
echo "net.ipv4.conf.default.accept_redirects = 0" >> /etc/sysctl.conf
|
189
|
193
|
else
|
|
194
|
+ sed -i "s|# net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
|
190
|
195
|
sed -i "s|#net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
|
191
|
196
|
sed -i "s|net.ipv4.conf.default.accept_redirects.*|net.ipv4.conf.default.accept_redirects = 0|g" /etc/sysctl.conf
|
192
|
197
|
fi
|