]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/forwardfw/convert-dmz
Forward Firewall: added GPL header to all files
[people/teissler/ipfire-2.x.git] / config / forwardfw / convert-dmz
index 0722f5bef4acb23d7cf3f0da6f0897902f251350..3d91364259a437d3c478b8a36f5027c04b14a10f 100755 (executable)
@@ -1,17 +1,33 @@
 #!/usr/bin/perl
 
-######################################################################## 
-# Script:      convert-dmz
-# Date:                03.04.2013
-# Author:      Alexander Marx (amarx@ipfire.org)
-########################################################################
-#
-# This script converts old dmz holes rules from old Firewall
-# to the new one. This is a 2-step process.
-# STEP1: read old config and normalize settings
-# STEP2: check valid ip and save valid rules to new firewall
-# 
-########################################################################
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2013                                                          #
+#                                                                             #
+# 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 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.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+# Author: Alexander Marx (amarx@ipfire.org)                                   #
+###############################################################################
+#                                                                             #
+# This script converts old dmz holes rules from old firewall                  #
+# to the new one. This is a 2-step process.                                   #
+# STEP1: read old config and normalize settings                               #
+# STEP2: check valid ip and save valid rules to new firewall                  #
+#                                                                             #
+###############################################################################
 my @current=();
 my @alias=();
 my %configdmz=();
@@ -36,6 +52,12 @@ my $field15  = ''; #Port Number
 my $field16    = ''; #remark
 my $field26    = '00:00';
 my $field27    = '00:00';
+my $field28 = '';
+my $field29 = 'ALL';
+my $field30 = '';
+my $field31 = 'dnat';
+
+
 open(FILE, $dmzconfig) or die 'Unable to open config file.';
 my @current = <FILE>;
 close(FILE);
@@ -141,6 +163,10 @@ sub process_rules{
                $configfwdfw{$key}[25] = '';
                $configfwdfw{$key}[26] = $field26;
                $configfwdfw{$key}[27] = $field27;
+               $configfwdfw{$key}[28] = $field28;
+               $configfwdfw{$key}[29] = $field29;
+               $configfwdfw{$key}[30] = $field30;
+               $configfwdfw{$key}[31] = $field31;
                print LOG "$Now -> Converted to $field0,$field1,$field2,$field3,$field4,$field5,$field6,,,,,$field11,$field12,$field13,$field14,$field15,$field16,,,,,,,,,,$field26,$field27\n";
        }
        &General::writehasharray($fwdfwconfig,\%configfwdfw);