From b48955cc85b998e387c5de75ed60ce432993f2bb Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Iniesta Date: Fri, 24 Feb 2012 11:40:25 +0100 Subject: Last correction to the send_redirects patch. Also added a note on the new init.d script behaviour regarding all.send_redirects. --- debian/openvpn.init.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'debian/openvpn.init.d') diff --git a/debian/openvpn.init.d b/debian/openvpn.init.d index 62a6bc5..cb326bf 100644 --- a/debian/openvpn.init.d +++ b/debian/openvpn.init.d @@ -70,7 +70,10 @@ start_vpn () { # Save the default value for send_redirects before disabling it # to make sure the tun device is created with send_redirects disabled SAVED_DEFAULT_SEND_REDIRECTS=$(sysctl -n net.ipv4.conf.default.send_redirects) - sysctl -w net.ipv4.conf.default.send_redirects=0 > /dev/null + + if [ "$SAVED_DEFAULT_SEND_REDIRECTS" -ne 0 ]; then + sysctl -w net.ipv4.conf.default.send_redirects=0 > /dev/null + fi fi fi @@ -86,7 +89,7 @@ start_vpn () { [ "$OMIT_SENDSIGS" -ne 1 ] || ln -s /var/run/openvpn.$NAME.pid /run/sendsigs.omit.d/openvpn.$NAME.pid # Set the back the original default value of send_redirects if it was changed - if [ -n "$SAVED_DEFAULT_SEND_REDIRECTS" ]; then + if [ "$SAVED_DEFAULT_SEND_REDIRECTS" -ne 0 ]; then sysctl -w net.ipv4.conf.default.send_redirects=$SAVED_DEFAULT_SEND_REDIRECTS > /dev/null fi } -- cgit v1.2.3