diff options
author | Chris Buechler <cmb@pfsense.org> | 2012-02-27 11:39:11 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2012-02-27 11:39:11 -0800 |
commit | fcab94e409ed2bc7e158ca2cd7f4310716fed85c (patch) | |
tree | 99092cf3ab2343005212ea97c3fa76d8a67c2686 | |
parent | 3b89830d2526030a7fbf6651c27a1577bea43e0b (diff) | |
parent | aeabd8243b0060679ff1c7c2219d557f1b0daec7 (diff) | |
download | pfsense-packages-fcab94e409ed2bc7e158ca2cd7f4310716fed85c.tar.gz pfsense-packages-fcab94e409ed2bc7e158ca2cd7f4310716fed85c.tar.bz2 pfsense-packages-fcab94e409ed2bc7e158ca2cd7f4310716fed85c.zip |
Merge pull request #221 from dvserg/master
Havp Fixes
-rw-r--r-- | config/havp/havp.inc | 21 |
1 files 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); |