diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2012-03-01 13:44:46 +0000 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2012-03-01 13:44:46 +0000 |
commit | c1e9fda73e0c994a2b89a8ebb096f0ffab2f3a7e (patch) | |
tree | 12fb02bf91c0d721f7b9d153c89e3830eb7a9e50 | |
parent | abbcd96bcef879d3916eccca26e57625498e6bf2 (diff) | |
download | aports-c1e9fda73e0c994a2b89a8ebb096f0ffab2f3a7e.tar.bz2 aports-c1e9fda73e0c994a2b89a8ebb096f0ffab2f3a7e.tar.xz |
testing/ipset: init script added
-rw-r--r-- | testing/ipset/APKBUILD | 11 | ||||
-rw-r--r-- | testing/ipset/ipset.initd | 24 |
2 files changed, 32 insertions, 3 deletions
diff --git a/testing/ipset/APKBUILD b/testing/ipset/APKBUILD index e731af0c37..2968393813 100644 --- a/testing/ipset/APKBUILD +++ b/testing/ipset/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: pkgname=ipset pkgver=6.11 -pkgrel=0 +pkgrel=1 pkgdesc="Manage Linux IP sets" url=http://ipset.netfilter.org/ arch=all @@ -10,7 +10,7 @@ license=GPL-2 depends_dev=libmnl-dev makedepends="$depends_dev automake autoconf pkgconfig libtool linux-headers" subpackages="$pkgname-dev $pkgname-doc" -source=${url}ipset-$pkgver.tar.bz2 +source="${url}ipset-$pkgver.tar.bz2 ipset.initd" _builddir=$srcdir/ipset-$pkgver @@ -33,6 +33,11 @@ package() { cd "$_builddir" make install DESTDIR=$pkgdir || return rm $pkgdir/usr/lib/*.la + + mkdir -p "$pkgdir/etc/init.d" \ + "$pkgdir/etc/ipset.d" + install -m 755 "$startdir/ipset.initd" "$pkgdir/etc/init.d/ipset" } -md5sums="bfcc92e30a0fcf10ae6e7c4affa03c84 ipset-6.11.tar.bz2" +md5sums="bfcc92e30a0fcf10ae6e7c4affa03c84 ipset-6.11.tar.bz2 +9f2e07dc13cafe456aa9d70fb631f175 ipset.initd" diff --git a/testing/ipset/ipset.initd b/testing/ipset/ipset.initd new file mode 100644 index 0000000000..6e3294c8e0 --- /dev/null +++ b/testing/ipset/ipset.initd @@ -0,0 +1,24 @@ +#!/sbin/runscript +# Init script for ipset +# Copyright (C) 2012 Kaarle Ritvanen +# Licensed under the terms of the GPL2 + +depend() { + before iptables ip6tables +} + +start() { + if ls /etc/ipset.d/* &> /dev/null; then + ebegin "Loading firewall IP sets" + for f in /etc/ipset.d/*; do + /usr/sbin/ipset restore < $f + done + eend $? + fi +} + +stop() { + ebegin "Flushing firewall IP sets" + /usr/sbin/ipset destroy + eend $? +} |