Handle hostnames with upper-case letters
[webmin.git] / itsecur-firewall / migrate-groups.pl
1 $nat_file="/etc/webmin/itsecur-firewall/nat";
2 $groups_file="/etc/webmin/itsecur-firewall/groups";
3
4 local ($iface, @nets, @maps);
5
6 open(NAT, $nat_file) || return ( );
7 open(GROUPS, ">>$groups_file");
8
9 chop($iface = <NAT>);
10 while(<NAT>) {
11         s/\r|\n//g;
12         if (/^(\S+)$/) {
13                 }
14         elsif (/^(\S+)\t+(\S+)\t+(\S+)$/) {
15                 print GROUPS "$2\t$2\n";
16                 }
17         elsif (/^(\S+)\t+(\S+)$/) {
18                 print GROUPS "$2\t$2\n";
19                 }
20         }
21 close(NAT);
22 close(GROUPS);
23