aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-05-05 17:18:59 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-05-05 17:18:59 -0300
commite17fb7835de45d988b44d557e95ae686f9bd5c37 (patch)
tree5321441d9faed013bd754b685891d29c2c61aa33 /config
parent65a85c16b76449f0296b3bd8b02c4aa1a90c590b (diff)
downloadpfsense-packages-e17fb7835de45d988b44d557e95ae686f9bd5c37.tar.gz
pfsense-packages-e17fb7835de45d988b44d557e95ae686f9bd5c37.tar.bz2
pfsense-packages-e17fb7835de45d988b44d557e95ae686f9bd5c37.zip
Declare pfs_version as global on first usage
Diffstat (limited to 'config')
-rw-r--r--config/lightsquid/lightsquid.inc7
-rw-r--r--config/nut/nut.inc1
2 files changed, 5 insertions, 3 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc
index 233f42d3..a5f6b77b 100644
--- a/config/lightsquid/lightsquid.inc
+++ b/config/lightsquid/lightsquid.inc
@@ -39,6 +39,7 @@ if (file_exists('squid.inc')) {
}
else update_log("File 'squid.inc' not found.");
+global $pfs_version;
$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
switch ($pfs_version) {
case "2.1":
@@ -115,6 +116,8 @@ 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
@@ -123,7 +126,6 @@ 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';
@@ -173,11 +175,10 @@ function lightsquid_deinstall() {
}
function lightsquid_resync() {
- global $config;
+ global $config, $pfs_version;
$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/nut/nut.inc b/config/nut/nut.inc
index 9ba942ab..a186ab30 100644
--- a/config/nut/nut.inc
+++ b/config/nut/nut.inc
@@ -35,6 +35,7 @@
define('NUT_RCFILE', '/usr/local/etc/rc.d/nut.sh');
+ global $pfs_version;
$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
if ($pfs_version == "2.1" || $pfs_version == "2.2") {
define('NUT_DIR', '/usr/pbi/nut-' . php_uname("m") . '/etc/nut');