Handle hostnames with upper-case letters
[webmin.git] / itsecur-firewall / apply.pl
1 #!/usr/bin/perl
2 # apply.pl
3 # Apply the firewall configuration
4
5 $ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin";
6 $ENV{'WEBMIN_VAR'} ||= "/var/webmin";
7 $no_acl_check++;
8 if ($0 =~ /^(.*\/)[^\/]+$/) {
9         chdir($1);
10         }
11 require './itsecur-lib.pl';
12 $module_name eq 'itsecur-firewall' || die "Command must be run with full path";
13
14 print "$text{'apply_doing'}\n";
15 &enable_routing();
16 $err = &apply_rules();
17 if ($err) {
18         print &text('apply_failed', $err),"\n";
19         exit(1);
20         }
21 else {
22         print "$text{'apply_done'}\n";
23         exit(0);
24         }
25