Gentoo Archives: gentoo-commits

From: Aaron Bauman <bman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/iptables/files/
Date: Sat, 20 Jul 2019 19:39:15
Message-Id: 1563651468.582ddf7c9cd3a1cdf225aeb1cde0953961a98ab2.bman@gentoo
1 commit: 582ddf7c9cd3a1cdf225aeb1cde0953961a98ab2
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Wed Jul 10 18:47:01 2019 +0000
4 Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 20 19:37:48 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=582ddf7c
7
8 net-firewall/iptables: remove unused file
9
10 Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/12417
12 Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
13
14 .../iptables/files/iptables-1.4.13-r1.init | 129 ---------------------
15 1 file changed, 129 deletions(-)
16
17 diff --git a/net-firewall/iptables/files/iptables-1.4.13-r1.init b/net-firewall/iptables/files/iptables-1.4.13-r1.init
18 deleted file mode 100644
19 index b410b4ff52b..00000000000
20 --- a/net-firewall/iptables/files/iptables-1.4.13-r1.init
21 +++ /dev/null
22 @@ -1,129 +0,0 @@
23 -#!/sbin/openrc-run
24 -# Copyright 1999-2013 Gentoo Foundation
25 -# Distributed under the terms of the GNU General Public License v2
26 -
27 -extra_commands="check save panic"
28 -extra_started_commands="reload"
29 -
30 -iptables_name=${SVCNAME}
31 -case ${iptables_name} in
32 -iptables|ip6tables) ;;
33 -*) iptables_name="iptables" ;;
34 -esac
35 -
36 -iptables_bin="/sbin/${iptables_name}"
37 -case ${iptables_name} in
38 - iptables) iptables_proc="/proc/net/ip_tables_names"
39 - iptables_save=${IPTABLES_SAVE};;
40 - ip6tables) iptables_proc="/proc/net/ip6_tables_names"
41 - iptables_save=${IP6TABLES_SAVE};;
42 -esac
43 -
44 -depend() {
45 - need localmount #434774
46 - before net
47 -}
48 -
49 -set_table_policy() {
50 - local chains table=$1 policy=$2
51 - case ${table} in
52 - nat) chains="PREROUTING POSTROUTING OUTPUT";;
53 - mangle) chains="PREROUTING INPUT FORWARD OUTPUT POSTROUTING";;
54 - filter) chains="INPUT FORWARD OUTPUT";;
55 - *) chains="";;
56 - esac
57 - local chain
58 - for chain in ${chains} ; do
59 - ${iptables_bin} -t ${table} -P ${chain} ${policy}
60 - done
61 -}
62 -
63 -checkkernel() {
64 - if [ ! -e ${iptables_proc} ] ; then
65 - eerror "Your kernel lacks ${iptables_name} support, please load"
66 - eerror "appropriate modules and try again."
67 - return 1
68 - fi
69 - return 0
70 -}
71 -checkconfig() {
72 - if [ ! -f ${iptables_save} ] ; then
73 - eerror "Not starting ${iptables_name}. First create some rules then run:"
74 - eerror "/etc/init.d/${iptables_name} save"
75 - return 1
76 - fi
77 - return 0
78 -}
79 -
80 -start() {
81 - checkconfig || return 1
82 - ebegin "Loading ${iptables_name} state and starting firewall"
83 - ${iptables_bin}-restore ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
84 - eend $?
85 -}
86 -
87 -stop() {
88 - if [ "${SAVE_ON_STOP}" = "yes" ] ; then
89 - save || return 1
90 - fi
91 - checkkernel || return 1
92 - ebegin "Stopping firewall"
93 - local a
94 - for a in $(cat ${iptables_proc}) ; do
95 - set_table_policy $a ACCEPT
96 -
97 - ${iptables_bin} -F -t $a
98 - ${iptables_bin} -X -t $a
99 - done
100 - eend $?
101 -}
102 -
103 -reload() {
104 - checkkernel || return 1
105 - checkrules || return 1
106 - ebegin "Flushing firewall"
107 - local a
108 - for a in $(cat ${iptables_proc}) ; do
109 - ${iptables_bin} -F -t $a
110 - ${iptables_bin} -X -t $a
111 - done
112 - eend $?
113 -
114 - start
115 -}
116 -
117 -checkrules() {
118 - ebegin "Checking rules"
119 - ${iptables_bin}-restore --test ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
120 - eend $?
121 -}
122 -
123 -check() {
124 - # Short name for users of init.d script.
125 - checkrules
126 -}
127 -
128 -save() {
129 - ebegin "Saving ${iptables_name} state"
130 - checkpath -q -d "$(dirname "${iptables_save}")"
131 - checkpath -q -m 0600 -f "${iptables_save}"
132 - ${iptables_bin}-save ${SAVE_RESTORE_OPTIONS} > "${iptables_save}"
133 - eend $?
134 -}
135 -
136 -panic() {
137 - checkkernel || return 1
138 - if service_started ${iptables_name}; then
139 - rc-service ${iptables_name} stop
140 - fi
141 -
142 - local a
143 - ebegin "Dropping all packets"
144 - for a in $(cat ${iptables_proc}) ; do
145 - ${iptables_bin} -F -t $a
146 - ${iptables_bin} -X -t $a
147 -
148 - set_table_policy $a DROP
149 - done
150 - eend $?
151 -}