From 87c83c431e7d59c3f9f89e144cc5de49919e47cb Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sun, 3 Jan 2010 16:25:48 -0500 Subject: [PATCH] Add new invirt-iptables package to allow stacking iptables rules. svn path=/trunk/packages/invirt-iptables/; revision=2861 --- debian/changelog | 6 ++++++ debian/compat | 1 + debian/control | 13 +++++++++++++ debian/copyright | 16 ++++++++++++++++ debian/invirt-iptables.dirs | 1 + debian/invirt-iptables.init | 41 +++++++++++++++++++++++++++++++++++++++++ debian/rules | 5 +++++ 7 files changed, 83 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/invirt-iptables.dirs create mode 100755 debian/invirt-iptables.init create mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..493d73e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +invirt-iptables (1) unstable; urgency=low + + * Initial Release. + + -- Evan Broder Sun, 03 Jan 2010 15:13:00 -0600 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..5572c28 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: invirt-iptables +Section: base +Priority: extra +Maintainer: Invirt project +Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0) +Standards-Version: 3.8.3 + +Package: invirt-iptables +Architecture: all +Depends: ${misc:Depends}, iptables +Description: Invirt iptables rules + This package allows other packages to distribute iptables rules to be + loaded idempotently and atomically at startup. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..361ca8f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,16 @@ +This software was written as part of the Invirt project . + +Copyright : + + 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 2 of the License, or + (at your option) any later version. + + This program 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. + +On Debian systems, the complete text of the GNU General Public License +can be found in the file /usr/share/common-licenses/GPL. diff --git a/debian/invirt-iptables.dirs b/debian/invirt-iptables.dirs new file mode 100644 index 0000000..f398222 --- /dev/null +++ b/debian/invirt-iptables.dirs @@ -0,0 +1 @@ +usr/share/invirt-iptables/rules.d diff --git a/debian/invirt-iptables.init b/debian/invirt-iptables.init new file mode 100755 index 0000000..916dda3 --- /dev/null +++ b/debian/invirt-iptables.init @@ -0,0 +1,41 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: invirt-iptables +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Invirt iptables rules +# Description: +### END INIT INFO + +NAME=invirt-iptables +DESC="Invirt iptables rules" +RULES=/usr/share/invirt-iptables/rules.d +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +dpkg -s "$NAME" >/dev/null 2>/dev/null || exit 0 + +. /lib/init/std-init.sh + +do_start() +{ + echo 1 > /proc/sys/net/ipv4/ip_forward + + for table in $(sed -ne 's/^*//p' $(run-parts --list "$RULES")); do + iptables -t "$table" -F + done + cat $(run-parts --list "$RULES") | iptables-restore -n +} + +do_reload() +{ + do_start +} + +do_stop() +{ + return 0 +} + +std_init "$1" diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0c6ba40 --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f + +DEB_UPDATE_RCD_PARAMS_invirt-iptables = defaults 98 2 + +include /usr/share/cdbs/1/rules/debhelper.mk -- 1.7.9.5