mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-10 15:48:13 +01:00
Handle Down or missing interfaces in 'delete_gateway()'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
792b3b696c
commit
35bd1db7fb
@ -996,9 +996,16 @@ delete_gateway() # $! = Description of the Gateway $2 = table number $3 = device
|
|||||||
|
|
||||||
if [ -n "$route" ]; then
|
if [ -n "$route" ]; then
|
||||||
if echo $route | grep -qF ' nexthop '; then
|
if echo $route | grep -qF ' nexthop '; then
|
||||||
gateway="nexthop $gateway"
|
if interface_is_up $3; then
|
||||||
eval route=\`echo $route \| sed \'s/$gateway/ /\'\`
|
gateway="nexthop $gateway"
|
||||||
run_ip route replace table $2 $route
|
else
|
||||||
|
gateway="nexthop $gateway dead"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if eval echo $route \| fgrep -q \'$gateway\'; then
|
||||||
|
eval route=\`echo $route \| sed \'s/$gateway/ /\'\`
|
||||||
|
run_ip route replace table $2 $route
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
dev=$(find_device $route)
|
dev=$(find_device $route)
|
||||||
[ "$dev" = "$3" ] && run_ip route delete default table $2
|
[ "$dev" = "$3" ] && run_ip route delete default table $2
|
||||||
|
Loading…
Reference in New Issue
Block a user