diff options
author | Chris Buechler <cmb@pfsense.org> | 2011-08-08 17:07:57 -0700 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2011-08-08 17:07:57 -0700 |
commit | b7a086a4b60cdee577fd4592414fa80fa10bf01f (patch) | |
tree | 28e65e144e0ccaf3b806cea9c96ac4c7006c083f /config | |
parent | 5602c62fde32eb1203bad617870af9ae39363483 (diff) | |
parent | d0c93be5ad5addece1b3328d0cf97c911dcf7ed8 (diff) | |
download | pfsense-packages-b7a086a4b60cdee577fd4592414fa80fa10bf01f.tar.gz pfsense-packages-b7a086a4b60cdee577fd4592414fa80fa10bf01f.tar.bz2 pfsense-packages-b7a086a4b60cdee577fd4592414fa80fa10bf01f.zip |
Merge pull request #30 from marcelloc/patch-23
include enable/disable and managment options
Diffstat (limited to 'config')
-rw-r--r-- | config/varnish64/varnish.inc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index 654a8bae..3e1aa81e 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -81,7 +81,11 @@ function varnish_deinstall() { } function varnish_start() { - mwexec("/usr/local/etc/rc.d/varnish.sh"); + global $g, $config; + if ($config['installedpackages']['varnishsettings']['config'][0]['enablevarnish']) + mwexec("/usr/local/etc/rc.d/varnish.sh"); + else + mwexec("/usr/bin/killall varnishd"); } /* Build the URL mappings logic VCL config txt */ @@ -137,6 +141,10 @@ function create_varnish_rcd_file() { $listeningport = "-a :{$vs['listeningport']}"; else $listeningport = "-a :80"; + if($vs['managment']) + $managment = "-T {$vs['managment']}"; + else + $managment = ""; if($vs['minworkers']) $minworkers = "{$vs['minworkers']}"; else @@ -178,7 +186,8 @@ ENDOFF {$listeningport} \ -f /var/etc/default.vcl \ {$storage_type} \ - -w {$minworkers},{$maxworkers},{$timeoutworkers} + -w {$minworkers},{$maxworkers},{$timeoutworkers} \ + {$managment} EOF; fwrite($fd, $rc_file); |