From 65a85c16b76449f0296b3bd8b02c4aa1a90c590b Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 5 May 2015 15:51:48 -0300 Subject: For some reason, global pfs_version has a wrong value during installation. Force it to re-read /etc/version inside functions --- config/lightsquid/lightsquid.inc | 6 +++--- config/lightsquid/lightsquid.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config/lightsquid') diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc index 60ec1fc9..233f42d3 100644 --- a/config/lightsquid/lightsquid.inc +++ b/config/lightsquid/lightsquid.inc @@ -115,8 +115,6 @@ define('LS_XML_SHEDULERTIME', 'lightsquid_refreshsheduler_time'); define('LS_XML_SQUID_SHEDULERTIME', 'lightsquid_squidrotatelog_sheduler_time'); function lightsquid_install() { - global $pfs_version; - update_log("lightsquid_install: started"); // create lightsquid report catalog @@ -125,6 +123,7 @@ function lightsquid_install() { mwexec("/bin/mkdir -p " . LS_REPORTPATH); } + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); if ($pfs_version == "2.1" || $pfs_version == "2.2") { # check perl $perl_path = '/usr/bin/perl'; @@ -174,10 +173,11 @@ function lightsquid_deinstall() { } function lightsquid_resync() { - global $config, $pfs_version; + global $config; $tm = ''; $tm_squid = ''; + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); if ($pfs_version == "2.1" || $pfs_version == "2.2") { # check perl if (!file_exists("/usr/bin/perl")) diff --git a/config/lightsquid/lightsquid.xml b/config/lightsquid/lightsquid.xml index 4f60997c..f5f09b94 100644 --- a/config/lightsquid/lightsquid.xml +++ b/config/lightsquid/lightsquid.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. lightsquid - 2.40 + 2.41 Services: Proxy Reports (LightSquid, SQStat) -> Settings Status /usr/local/pkg/lightsquid.inc -- cgit v1.2.3