blob: 53459ab5f5387be9490537117bec7aa1390cbf6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
--- /usr/share/shorewall-shell/lib.providers
+++ ./lib.providers
@@ -149,11 +149,13 @@
save_command "${iface}_up=Yes"
- save_command "qt ip route flush table $number"
+ if [ "x$gateway" != "xnone" ]; then
+ save_command "qt ip route flush table $number"
- indent >&3 << __EOF__
+ indent >&3 << __EOF__
echo "qt ip route flush table $number" >> \${VARDIR}/undo_routing
__EOF__
+ fi
if [ "x${duplicate:=-}" != x- ]; then
if [ "x${copy:=-}" != "x-" ]; then
@@ -183,6 +185,8 @@
fi
__EOF__
+ elif [ "x$gateway" = "xnone" ]; then
+ gateway=
elif [ "x$gateway" != "x-" -a -n "$gateway" ]; then
indent >&3 << __EOF__
run_ip route replace $gateway src \$(find_first_interface_address $interface) dev $interface table $number
--- ./lib.providers.orig
+++ ./lib.providers
@@ -408,7 +408,7 @@
save_command "#"
save_command "# We don't have any 'balance' providers so we retore any default route that we've saved"
save_command "#"
- save_command restore_default_route
+# save_command restore_default_route
fi
save_command "if [ -w /etc/iproute2/rt_tables ]; then"
--- ./lib.providers.orig
+++ ./lib.providers
@@ -267,7 +267,7 @@
rulenum=\$((\$rulenum + 1))
done
__EOF__
- elif [ -n "$DELETE_THEN_ADD" ]; then
+ elif [ -n "$DELETE_THEN_ADD" ] && [ -n "$gateway" ]; then
indent >&3 << __EOF__
find_interface_addresses $interface | while read address; do
|