From aeabd8243b0060679ff1c7c2219d557f1b0daec7 Mon Sep 17 00:00:00 2001 From: Sergey Dvoriancev Date: Mon, 27 Feb 2012 23:35:37 +0400 Subject: Fix: filter rules off if havp disabled; start script update; --- config/havp/havp.inc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/config/havp/havp.inc b/config/havp/havp.inc index 5b420d21..71a1a93b 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -344,8 +344,8 @@ function havp_resync() havp_reconfigure_freshclam(); havp_reconfigure_cron(); - # configure system filter - if (pfsense_version_() == '1') filter_configure(); + # configure system filter for 2.xx + if (pfsense_version_() !== '1') filter_configure(); } # ------------------------------------------------------------------------------ @@ -1140,6 +1140,11 @@ function havp_generate_rules($type = 'filter') global $config, $havp_config; $rules = array(); + # no rules if havp disabled + if ($havp_config[F_ENABLE] !== 'true') { + return ''; + } + $proxymode = $havp_config[F_PROXYMODE]; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # =-= HAVP always listen 127.0.0.1:port =-= @@ -1295,7 +1300,10 @@ function havp_startup_script() $rc = array(); $rc['file'] = basename(HVDEF_HAVP_STARTUP_SCRIPT); - $s[] = "# start"; + $s[] = "\t# init"; + $s[] = "\techo 'Starting ..' > " . HVDEF_HAVP_STATUS_FILE; + + $s[] = "\t# start"; $s[] = "\tif [ -z \"`{$havpchk}`\" ];then"; if (HV_USE_CLAMD === 'true') { $clampid_dir = HVDEF_CLAM_RUNDIR; @@ -1319,8 +1327,15 @@ function havp_startup_script() } $s[] = "\t\t/usr/local/sbin/havp -c " . HVDEF_HAVP_CONFIG . " 2>/dev/null"; $s[] = "\t\twait"; + $s[] = "\tfi"; + + $s[] = "\t# Status"; + $s[] = "\tif [ -z \"`{$havpchk}`\" ];then"; + $s[] = "\t\techo 'Stopped' > " . HVDEF_HAVP_STATUS_FILE; + $s[] = "\telse"; $s[] = "\t\techo 'Started' > " . HVDEF_HAVP_STATUS_FILE; $s[] = "\tfi"; + $s[] = ""; $rc['start'] = implode("\n", $s); unset($s); -- cgit v1.2.3