diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-06-26 14:47:00 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-06-26 14:47:00 +0000 |
commit | 2c42b21247e3a50c500f5dbea1549092022c30ad (patch) | |
tree | e0dfa683aaadb74fdedcd8428a95b629277addec /main/shorewall-shell | |
parent | b980464b680a4f7f7187d0c5107a1b1840139ba1 (diff) | |
download | aports-2c42b21247e3a50c500f5dbea1549092022c30ad.tar.bz2 aports-2c42b21247e3a50c500f5dbea1549092022c30ad.tar.xz |
main/shorewall-shell: add option to disable saving/restoring default route
When starting, shorewall will save all default routes. When stop, it
will try to restore it. But does it badly. On multiisp setups with pingu
it will break things.
We (ab)use the RESTORE_DEFAULT_ROUTE to make it possible to avoid
restoring the default route.
Diffstat (limited to 'main/shorewall-shell')
-rw-r--r-- | main/shorewall-shell/APKBUILD | 6 | ||||
-rw-r--r-- | main/shorewall-shell/restore-default-route.patch | 13 | ||||
-rw-r--r-- | main/shorewall-shell/shorewall-shell.post-install | 6 |
3 files changed, 23 insertions, 2 deletions
diff --git a/main/shorewall-shell/APKBUILD b/main/shorewall-shell/APKBUILD index c23e11d146..53849231de 100644 --- a/main/shorewall-shell/APKBUILD +++ b/main/shorewall-shell/APKBUILD @@ -2,7 +2,7 @@ pkgname=shorewall-shell _v=4.2.11 pkgver=4.2.11 -pkgrel=4 +pkgrel=5 pkgdesc="Shoreline Firewall shell-based compiler." url="http://www.shorewall.net/" arch="noarch" @@ -14,6 +14,7 @@ source="http://www.shorewall.net/pub/shorewall/${_v%.*}/shorewall-$_v/$pkgname-$ shorewall-shell-ipset.patch shorewall-shell-providers-gateway-none.patch shorewall-shell-rp_filter.patch + restore-default-route.patch " _builddir="$srcdir"/$pkgname-$pkgver @@ -35,4 +36,5 @@ md5sums="518a7f389a6f606c109acb7dfbe18372 shorewall-shell-4.2.11.tar.bz2 64c01bc4f57203fb877bb334994eac38 shorewall-policyrouting.patch 79745ea284a08cb167b9a356ee0bff3b shorewall-shell-ipset.patch 0c6106a8cbb95d21c0c878a6235a65ac shorewall-shell-providers-gateway-none.patch -d5eadb6be45aa41f80669452baa853a6 shorewall-shell-rp_filter.patch" +d5eadb6be45aa41f80669452baa853a6 shorewall-shell-rp_filter.patch +c971270086d5de15327f498d1be64fcb restore-default-route.patch" diff --git a/main/shorewall-shell/restore-default-route.patch b/main/shorewall-shell/restore-default-route.patch new file mode 100644 index 0000000000..8640589420 --- /dev/null +++ b/main/shorewall-shell/restore-default-route.patch @@ -0,0 +1,13 @@ +--- ./lib.providers.orig ++++ ./lib.providers +@@ -378,7 +378,9 @@ + # + # Capture the default route(s) if we don't have it (them) already. + # +-[ -f \${VARDIR}/default_route ] || ip route list | grep -E '^\s*(default |nexthop )' > \${VARDIR}/default_route ++if [ "\$RESTORE_DEFAULT_ROUTE" != "No" ] && ! [ -f \${VARDIR}/default_route ]; then ++ ip route list | grep -E '^\s*(default |nexthop )' > \${VARDIR}/default_route ++fi + # + # Initialize the file that holds 'undo' commands + # diff --git a/main/shorewall-shell/shorewall-shell.post-install b/main/shorewall-shell/shorewall-shell.post-install new file mode 100644 index 0000000000..34f18779ad --- /dev/null +++ b/main/shorewall-shell/shorewall-shell.post-install @@ -0,0 +1,6 @@ +#!/bin/sh + +# loglevel needs to be lowercase +if grep -q INFO /etc/shorewall/rules; then + sed '/^[^#].*[[:space:]]\+INFO/s/\([[:space:]]\)\+INFO[[:space:]]*$/\1info/' \ + /etc/shorewall/policy |