From 8531b94ae07f0f9d6897d2a03f5cf713131b2b13 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 1 Mar 2014 18:07:39 +0100 Subject: [PATCH] firewall: rules.pl: Remove command line args parsing and rest from old debugging mode. --- config/firewall/rules.pl | 47 +++++++++++++--------------------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl index 6bb9ea0af..d8ca67dd8 100755 --- a/config/firewall/rules.pl +++ b/config/firewall/rules.pl @@ -85,38 +85,21 @@ open (CONN1,"/var/ipfire/red/local-ipaddress"); my $redip = ; close(CONN1); -################# -# DEBUG/TEST # -################# -my $MODE=!$DEBUG; # 0 - normal operation - # 1 - print configline and rules to console - # -################# -my $param=shift; - -if($param eq 'flush'){ - if ($MODE eq '1'){ - print " Flushing chains...\n"; - } - &flush; -}else{ - if ($MODE eq '1'){ - print " Flushing chains...\n"; - } - &flush; - if ($MODE eq '1'){ - print " Preparing rules...\n"; - } - &preparerules; - if($MODE eq '0'){ - if ($fwdfwsettings{'POLICY'} eq 'MODE1'){ - &p2pblock; - run("/usr/sbin/firewall-policy"); - }elsif($fwdfwsettings{'POLICY'} eq 'MODE2'){ - &p2pblock; - run("/usr/sbin/firewall-policy"); - } - } +# MAIN +&main(); + +sub main { + # Flush all chains. + &flush(); + + # Reload firewall rules. + &preparerules(); + + # Load P2P block rules. + &p2pblock(); + + # Reload firewall policy. + run("/usr/sbin/firewall-policy"); } sub run { -- 2.39.2