Skip to content

Commit

Permalink
ipset-persistent-v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Ban committed Jul 3, 2018
0 parents commit 6463185
Show file tree
Hide file tree
Showing 25 changed files with 472 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/make -f

# This file is part of ipset-persistent
# Copyright (C) 2018 Adrian Ban
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.

PREFIX=/
DEST=$(DESTDIR)$(PREFIX)

all:

clean:

install:
install -d $(DEST)/usr/sbin
install -d $(DEST)/usr/share/netfilter-persistent
install -d $(DEST)/usr/share/netfilter-persistent/plugins.d
# Manual
install -d $(DEST)/usr/share/man/man8
install --mode=644 ipset-persistent.8 $(DEST)/usr/share/man/man8

install-plugins:
# Plugins
install plugins/* $(DEST)/usr/share/netfilter-persistent/plugins.d
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ipset-persistent

ipset-persistent plugin
------------------------------------

ipset-persistent is a plugin for netfilter-persistent to load, save and
flush the ipset rules.

7 changes: 7 additions & 0 deletions debian/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ipset-persistent plugin
------------------------------------

ipset-persistent is a plugin for netfilter-persistent to load, save and
flush the ipset rules.

-- Adrian Ban <adrian@abtelecom.ro> Tue, 03 Jul 2018 10:52:17 +0200
5 changes: 5 additions & 0 deletions debian/README.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

ipset-persistent is a plugin for netfilter-persistent for loading, saving and flushing
ipset rules.

-- Adrian Ban <adrian@abtelecom.ro> Tue, 03 Jul 2018 10:52:17 +0200
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
iptables-persistent (1.0.0) unstable; urgency=medium

* Plugin for ipset to be used with netfilter-persistent for
loading, saving, flushing ipset rules

-- Adrian Ban <adrian@abtelecom.ro> Tue, 3 Jul 2018 10:18:44 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
24 changes: 24 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Source: ipset-persistent
Section: admin
Priority: optional
Maintainer: Adrian Ban <adrian@abtelecom.ro>
Build-Depends: debhelper (>= 7.0.50~), dh-systemd, po-debconf
Standards-Version: 3.9.6
Vcs-Browser: https://github.com/AdrianBan/ipset-persistent/
Vcs-Git: git://github.com/AdrianBan/ipset-persistent

Package: ipset-persistent
Architecture: all
Depends: lsb-base, ${misc:Depends}, netfilter-persistent
Suggests: iptables-persistent
Description: boot-time loader for ipset configuration
This package provides a set of plugins for nettfilter for load, flush
and save a running ipset configuration.

Package: ipset-persistent
Architecture: all
Depends: netfilter-persistent (= ${source:Version}), ipset, ${misc:Depends}
Description: boot-time loader for ipset plugin
ipset-persistent is a loader for ipset plugin for netfilter-persistent
.
This package contains the ipset plugin.
24 changes: 24 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: iptables-persistent
Upstream-Contact: Jonathan Wiltshire <jmw@debian.org>

Files: *
Copyright: © 2009, Simon Richter <sjr@debian.org>
© 2010, Chris Silva <racerx@makeworld.com>
© 2010, Jonathan Wiltshire <jmw@debian.org>
License: GPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
6 changes: 6 additions & 0 deletions debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[DEFAULT]
compression = bzip2

[git-dch]
meta = true
id-length = 6
13 changes: 13 additions & 0 deletions debian/ipset-persistent.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

# Source debconf library
. /usr/share/debconf/confmodule

db_get ipset-persistent/autosave_done || true
if [ "x$RET" != "xtrue" ]; then
# Save ipset rules?
db_input high ipset-persistent/autosave || true
db_go
fi
2 changes: 2 additions & 0 deletions debian/ipset-persistent.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
etc/ipset
usr/share/netfilter-persistent/plugins.d
1 change: 1 addition & 0 deletions debian/ipset-persistent.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debian/README
2 changes: 2 additions & 0 deletions debian/ipset-persistent.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins/14-ipset usr/share/netfilter-persistent/plugins.d/
plugins/30-ipset usr/share/netfilter-persistent/plugins.d/
32 changes: 32 additions & 0 deletions debian/ipset-persistent.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

set -e

# Source debconf library
. /usr/share/debconf/confmodule

case "$1" in
configure)
db_get ipset-persistent/autosave_done || true
if [ "x$RET" != "xtrue" ]; then
db_get ipset-persistent/autosave || true
if [ "x$RET" = "xtrue" ]; then
if which ipset > /dev/null ; then
if ipset list > /dev/null; then
ipset save > /etc/ipset/rules
else
echo "IPSet: Unable to save (ipset module not loadable?)"
fi
else
echo "IPSet: Can't find ipset in $PATH, please check your system"
fi
fi

db_set ipset-persistent/autosave_done true || true
fi

update-rc.d ipset-persistent remove
;;
esac

#DEBHELPER#
11 changes: 11 additions & 0 deletions debian/ipset-persistent.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

case "$1" in
purge)
rm -rf /etc/ipset/rules
;;
esac

#DEBHELPER#
25 changes: 25 additions & 0 deletions debian/ipset-persistent.preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

set -e


case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" le "0.5.2"; then
update-rc.d -f ipset-persistent remove
fi
if [ -e /etc/ipset/rules ]; then
mv -f /etc/ipset/rules /etc/ipset/rules.dpkg-old
fi
;;

abort-upgrade)
;;

*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#
21 changes: 21 additions & 0 deletions debian/ipset-persistent.templates
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# These templates have been reviewed by the debian-l10n-english
# team
#
# If modifications/additions/rewording are needed, please ask
# debian-l10n-english@lists.debian.org for advice.
#
# Even minor modifications require translation updates and such
# changes should be coordinated with translators and reviewers.

Template: ipset-persistent/autosave
Type: boolean
Default: true
_Description: Save current IPSet rules?
Current ipset rules can be saved to the configuration
file /etc/ipset/rules. These rules will then be loaded automatically
during system startup.
.
Rules are only saved automatically during package installation. See the
manual page of ipset(8) for instructions on keeping the rules file
up-to-date.

1 change: 1 addition & 0 deletions debian/po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[type: gettext/rfc822deb] ipset-persistent.templates
47 changes: 47 additions & 0 deletions debian/po/ro.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ITALIAN TRANSLATION OF IPTABLES-PERSISTENT'S PO-DEBCONF FILE.
# COPYRIGHT (C) 2011 THE IPTABLES-PERSISTENT'S COPYRIGHT HOLDER
# This file is distributed under the same license as the iptables-persistent package.
# Vincenzo Campanella <vinz65@gmail.com>, 2011.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ipset-persistent\n"
"POT-Creation-Date: 2018-06-03 10:31+0200\n"
"PO-Revision-Date: 2018-06-03 10:31+0200\n"
"Last-Translator: Adrian Ban <adrian@abtelecom.ro>\n"
"Language-Team: Romanian <>\n"
"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. Type: boolean
#. Description
#: ../ipset-persistent.templates:2001
msgid "Save current IPSet rules?"
msgstr "Doriti sa salvati regulile curente?"

#. Type: boolean
#. Description
#: ../ipset-persistent.templates:2001
msgid ""
"Current ipset rules can be saved to the configuration"
"file /etc/ipset/rules. These rules will then be loaded automatically"
"during system startup."
msgstr ""
"Regulile curente de ipset pot fi salvate in fisierul /etc/ipset/rules."
"Aceste reguli vor fi incarcate automat la pornirea sistemului."

#. Type: boolean
#. Description
#: ../ipset-persistent.templates:2001
msgid ""
"Rules are only saved automatically during package installation. See the "
"manual page of ipset(8) for instructions on keeping the rules file "
"up-to-date."
msgstr ""
"Regulile sunt salvate automat doar in momentul instalarii acestui packet."
"Verificati manualul ipset(8) pentru instructiunile de salvare ale regulilor "
"ipset pentru a le mentine actualizate."

41 changes: 41 additions & 0 deletions debian/po/templates.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2011-01-15 20:39+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. Type: boolean
#. Description
#: ../ipset-persistent.templates:2001
msgid "Save current IPSet rules?"
msgstr ""

#. Type: boolean
#. Description
#: ../ipset-persistent.templates:2001
msgid ""
"Current ipset rules can be saved to the configuration"
"file /etc/ipset/rules. These rules will then be loaded automatically"
"during system startup."
msgstr ""

#. Type: boolean
#. Description
#: ../ipset-persistent.templates:2001
msgid ""
"Rules are only saved automatically during package installation. See the "
"manual page of ipset(8) for instructions on keeping the rules file "
"up-to-date."
msgstr ""
8 changes: 8 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/make -f

override_dh_installinit:
dh_installinit -- start 37 S . stop 37 0 1 6 .

%:
dh $@

1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
17 changes: 17 additions & 0 deletions ipset-persistent.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.TH ipset-persistent 8
.SH NAME
ipset-persistent \- plugin to load, flush and save ipset rule sets
.SH DESCRIPTION
.B ipset-persistent
adds necessary plugin to netfilter for flush and save ipset rules at boot and halt time.
.fi
You don't need to do anything additional, just use netfilter-persistent to load, flush and save ipset rules.
.SH COPYRIGHT
Copyright (C) 2018 Adrian Ban <adrian@abtelecom.ro>
.PP
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.SH AUTHORS
Adrian Ban <adrian@abtelecom.ro>
Loading

0 comments on commit 6463185

Please sign in to comment.