diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2019-02-02 20:01:37 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2019-02-03 16:42:48 +0200 |
commit | e95387aadc6fdb4fcb058553b1cd77c7525d680e (patch) | |
tree | a8a9c402f454c231e854c0bbb882a9dd537638e3 /main | |
parent | e7a1be8bb2bac70e2dd976e3cb2516679d06b0f3 (diff) | |
download | aports-e95387aadc6fdb4fcb058553b1cd77c7525d680e.tar.bz2 aports-e95387aadc6fdb4fcb058553b1cd77c7525d680e.tar.xz |
main/awall: upgrade to 1.6.10
Diffstat (limited to 'main')
-rw-r--r-- | main/awall/APKBUILD | 9 | ||||
-rwxr-xr-x | main/awall/awall-init | 18 | ||||
-rwxr-xr-x | main/awall/setup-firewall | 23 |
3 files changed, 33 insertions, 17 deletions
diff --git a/main/awall/APKBUILD b/main/awall/APKBUILD index aff081620c..0abba000dd 100644 --- a/main/awall/APKBUILD +++ b/main/awall/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> # Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> pkgname=awall -pkgver=1.6.9 +pkgver=1.6.10 pkgrel=0 pkgdesc="Alpine Wall" url="https://git.alpinelinux.org/cgit/awall/" @@ -15,6 +15,7 @@ depends="drill ip6tables ipset iptables lua$_luaver lua$_luaver-alt-getopt subpackages="$pkgname-masquerade $pkgname-policies" triggers="$pkgname.trigger=/usr/share/awall" source="https://dev.alpinelinux.org/archive/awall/awall-$pkgver.tar.xz + awall-init setup-firewall " @@ -33,6 +34,7 @@ check() { package() { cd "$builddir" make "ROOT_DIR=$pkgdir" LUA_VERSION=$_luaver install + install -D "$srcdir"/awall-init "$pkgdir"/usr/libexec/awall-init } masquerade() { @@ -52,5 +54,6 @@ policies() { install -D "$srcdir"/setup-firewall "$subpkgdir"/usr/sbin/setup-firewall } -sha512sums="9dd5c641a5c9469dbbe280ffd5283bb0a62203bcc07538d79f3154c118438ea2edd24636b39d92113dc8ca6994d02c7b14e9f136b48bff20808e4c35b6d68880 awall-1.6.9.tar.xz -c9307fe9d8d7cb64e20c3eb301628b6b57e3ccfa104bbe0f08204b4ee49214dcd67b81124094e35ff19603e19363b864140658f3b5138bb02dcff1670a068bd4 setup-firewall" +sha512sums="1f2a32cab0f0372f6dd455c4c5e42293c1e6f9fdf68cb24c6001090d7f40e8de743627237abc78d0bd06dff03f0c01ee2c6759099da22d01bfb6536d5d2e12b7 awall-1.6.10.tar.xz +e83ea3281c298092530e45fa5b62f6f85b9e5109b11e109799465ea832608294c7d9c4c3f5b0f321dfc0e82040daf3a17d066e9dea65cb0dbae2c453ea9e62cd awall-init +e3dd92377c13e88f5395d3c4ccf9bc3afbeb72a5601a17e98b186f8016734cc0ef51a657693f88891094f38f3cda61bb615fa618f29c43fbff7295bf2020dee8 setup-firewall" diff --git a/main/awall/awall-init b/main/awall/awall-init new file mode 100755 index 0000000000..a5d5dc7a55 --- /dev/null +++ b/main/awall/awall-init @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# Service setup script for Alpine Wall on Alpine Linux +# Copyright (C) 2018-2019 Kaarle Ritvanen + +SRV=$1 + +set_param() { + sed -Ei "s/^($1=).*\$/\\1$2/" /etc/conf.d/$SRV +} + +set_param SAVE_ON_STOP no +if [ "$FORWARD" != no ]; then + set_param IPFORWARD yes +fi + +rc-update add $SRV +service $SRV start diff --git a/main/awall/setup-firewall b/main/awall/setup-firewall index 720977d8a6..55bc1ad30a 100755 --- a/main/awall/setup-firewall +++ b/main/awall/setup-firewall @@ -1,7 +1,7 @@ #!/bin/sh -e # Firewall setup script for Alpine Linux -# Copyright (C) 2018 Kaarle Ritvanen +# Copyright (C) 2018-2019 Kaarle Ritvanen . /lib/libalpine.sh @@ -13,8 +13,12 @@ info() { fi } +_pgrep() { + pgrep -x $1 > /dev/null +} + is_running() { - busybox pgrep -x $1 > /dev/null + _pgrep $1 || _pgrep /usr/sbin/$1 } enable_policy() { @@ -119,20 +123,11 @@ EOF awall translate -set_param() { - sed -Ei "s/^($2=).*\$/\\1$3/" /etc/conf.d/$1 -} - enable_service() { echo "Enabling service $1" - - set_param $1 SAVE_ON_STOP no - if [ "$LAN_IFACES" ]; then - set_param $1 IPFORWARD yes - fi - - rc-update add $1 - service $1 start + local fwd= + [ "$LAN_IFACES" ] || fwd=no + FORWARD=$fwd /usr/libexec/awall-init $1 } enable_service iptables |