diff options
author | marcelloc <marcellocoutinho@gmail.com> | 2011-08-08 20:52:07 -0300 |
---|---|---|
committer | marcelloc <marcellocoutinho@gmail.com> | 2011-08-08 20:52:07 -0300 |
commit | d0c93be5ad5addece1b3328d0cf97c911dcf7ed8 (patch) | |
tree | 28e65e144e0ccaf3b806cea9c96ac4c7006c083f | |
parent | 5602c62fde32eb1203bad617870af9ae39363483 (diff) | |
download | pfsense-packages-d0c93be5ad5addece1b3328d0cf97c911dcf7ed8.tar.gz pfsense-packages-d0c93be5ad5addece1b3328d0cf97c911dcf7ed8.tar.bz2 pfsense-packages-d0c93be5ad5addece1b3328d0cf97c911dcf7ed8.zip |
include enable/disable and managment options
-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); |