summaryrefslogtreecommitdiffstats
path: root/testing/ipset
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-03-01 13:44:46 +0000
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-03-01 13:44:46 +0000
commitc1e9fda73e0c994a2b89a8ebb096f0ffab2f3a7e (patch)
tree12fb02bf91c0d721f7b9d153c89e3830eb7a9e50 /testing/ipset
parentabbcd96bcef879d3916eccca26e57625498e6bf2 (diff)
downloadaports-c1e9fda73e0c994a2b89a8ebb096f0ffab2f3a7e.tar.bz2
aports-c1e9fda73e0c994a2b89a8ebb096f0ffab2f3a7e.tar.xz
testing/ipset: init script added
Diffstat (limited to 'testing/ipset')
-rw-r--r--testing/ipset/APKBUILD11
-rw-r--r--testing/ipset/ipset.initd24
2 files changed, 32 insertions, 3 deletions
diff --git a/testing/ipset/APKBUILD b/testing/ipset/APKBUILD
index e731af0c3..296839381 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 000000000..6e3294c8e
--- /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 $?
+}