]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/helper/writeipac.pl
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
23 require '/var/ipfire/general-functions.pl';
28 General
::readhash
("${General::swroot}/ethernet/settings", \
%settings);
30 if (!open(FILE
, '>/etc/ipac-ng/rules.conf')) {
31 die "Unable to create /etc/ipac-ng/rules.conf"; }
33 if (open(IFACE
, "${General::swroot}/red/iface"))
40 print FILE
"incoming GREEN ($settings{'GREEN_DEV'})|ipac~o|$settings{'GREEN_DEV'}|all|||\n";
41 print FILE
"outgoing GREEN ($settings{'GREEN_DEV'})|ipac~i|$settings{'GREEN_DEV'}|all|||\n";
42 print FILE
"forwarded incoming GREEN ($settings{'GREEN_DEV'})|ipac~fi|$settings{'GREEN_DEV'}|all|||\n";
43 print FILE
"forwarded outgoing GREEN ($settings{'GREEN_DEV'})|ipac~fo|$settings{'GREEN_DEV'}|all|||\n";
45 if ($settings{'CONFIG_TYPE'} =~ /^(2|4)$/ )
47 print FILE
"incoming ORANGE ($settings{'ORANGE_DEV'})|ipac~o|$settings{'ORANGE_DEV'}|all|||\n";
48 print FILE
"outgoing ORANGE ($settings{'ORANGE_DEV'})|ipac~i|$settings{'ORANGE_DEV'}|all|||\n";
49 print FILE
"forwarded incoming ORANGE ($settings{'ORANGE_DEV'})|ipac~fi|$settings{'ORANGE_DEV'}|all|||\n";
50 print FILE
"forwarded outgoing ORANGE ($settings{'ORANGE_DEV'})|ipac~fo|$settings{'ORANGE_DEV'}|all|||\n";
53 if ($settings{'CONFIG_TYPE'} =~ /^(3|4)$/ )
55 print FILE
"incoming BLUE ($settings{'BLUE_DEV'})|ipac~o|$settings{'BLUE_DEV'}|all|||\n";
56 print FILE
"outgoing BLUE ($settings{'BLUE_DEV'})|ipac~i|$settings{'BLUE_DEV'}|all|||\n";
57 print FILE
"forwarded incoming BLUE ($settings{'BLUE_DEV'})|ipac~fi|$settings{'BLUE_DEV'}|all|||\n";
58 print FILE
"forwarded outgoing BLUE ($settings{'BLUE_DEV'})|ipac~fo|$settings{'BLUE_DEV'}|all|||\n";
61 print FILE
"incoming RED ($iface)|ipac~o|$iface|all|||\n";
62 print FILE
"outgoing RED ($iface)|ipac~i|$iface|all|||\n";
63 print FILE
"forwarded incoming RED ($iface)|ipac~fi|$iface|all|||\n";
64 print FILE
"forwarded outgoing RED ($iface)|ipac~fo|$iface|all|||\n";