mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 22:30:58 +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 echo $route | grep -qF ' nexthop '; then
|
||||
gateway="nexthop $gateway"
|
||||
eval route=\`echo $route \| sed \'s/$gateway/ /\'\`
|
||||
run_ip route replace table $2 $route
|
||||
if interface_is_up $3; then
|
||||
gateway="nexthop $gateway"
|
||||
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
|
||||
dev=$(find_device $route)
|
||||
[ "$dev" = "$3" ] && run_ip route delete default table $2
|
||||
|
Loading…
Reference in New Issue
Block a user