Refactoring of commit bf49e59e3e

Make sure the RPDB rules will be removed.
This commit is contained in:
Christian Ruppert 2011-09-21 03:57:09 +02:00
parent 930f4021b1
commit 29693ecb7a

View File

@ -301,9 +301,6 @@ iproute2_post_start()
iproute2_post_stop()
{
# Only do something if the interface actually exist
_exists || return
# Kernel may not have IP built in
if [ -e /proc/net/route ]; then
local rules="$(service_get_value "ip_rule")"
@ -311,7 +308,11 @@ iproute2_post_stop()
einfo "Removing RPDB rules"
_ip_rule_runner del "${rules}"
fi
ip route flush table cache dev "${IFACE}"
# Only do something if the interface actually exist
if _exists; then
ip route flush table cache dev "${IFACE}"
fi
fi
# Don't delete sit0 as it's a special tunnel