From d0c93be5ad5addece1b3328d0cf97c911dcf7ed8 Mon Sep 17 00:00:00 2001 From: marcelloc Date: Mon, 8 Aug 2011 20:52:07 -0300 Subject: include enable/disable and managment options --- config/varnish64/varnish.inc | 13 +++++++++++-- 1 file 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); -- cgit v1.2.3