summaryrefslogtreecommitdiff
path: root/debian/openvpn.init.d
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2012-02-24 11:40:25 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2012-02-24 11:40:25 +0100
commitb48955cc85b998e387c5de75ed60ce432993f2bb (patch)
tree7742641a545641a8df6c8feb2399b767528e3d29 /debian/openvpn.init.d
parent2de855eb717babbd24adbe5ddf9781a8a91ee9cc (diff)
Last correction to the send_redirects patch.
Also added a note on the new init.d script behaviour regarding all.send_redirects.
Diffstat (limited to 'debian/openvpn.init.d')
-rw-r--r--debian/openvpn.init.d7
1 files changed, 5 insertions, 2 deletions
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
}