diff options
-rw-r--r-- | config/lightsquid/lightsquid.inc | 42 | ||||
-rw-r--r-- | config/lightsquid/lightsquid.xml | 4 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 |
3 files changed, 40 insertions, 8 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc index 4b31bc30..399e0572 100644 --- a/config/lightsquid/lightsquid.inc +++ b/config/lightsquid/lightsquid.inc @@ -45,8 +45,11 @@ switch ($pfs_version) { case "2.0": define('LIGHTSQUID_BASE','/usr/local'); break; - default: + case "2.1": define('LIGHTSQUID_BASE', '/usr/pbi/lightsquid-' . php_uname("m")); + break; + default: + define('LIGHTSQUID_BASE', '/usr/pbi/lightsquid-' . php_uname("m") . '/local'); } define ('CMD_PKGDELETE', 'pkg_delete lightsquid-1.7.1'); @@ -117,19 +120,38 @@ function lightsquid_install() { // create lightsquid report catalog if (!file_exists(LS_REPORTPATH)) { update_log("lightsquid_install: Create report dir " . LS_REPORTPATH); - mwexec("mkdir -p " . LS_REPORTPATH); + mwexec("/bin/mkdir -p " . LS_REPORTPATH); } // install templates $lstpl_file = "/var/tmp/lightsquid_tpl.tbz"; if (file_exists($lstpl_file)) { - mwexec("tar zxvf $lstpl_file -C " . LS_TEMPLATEPATH); + mwexec("/usr/bin/tar zxvf $lstpl_file -C " . LS_TEMPLATEPATH); update_log("lightsquid_install: Install templates from $lstpl_file"); } # check perl - if (!file_exists("/usr/bin/perl")) - mwexec("ln -s /usr/local/bin/perl /usr/bin/perl"); + $perl_path = '/usr/bin/perl'; + + /* Clean up a bad perl link. */ + ls_cleanup_bad_link($perl_path); + + if (!file_exists("/usr/bin/perl")) { + if (is_executable('/usr/local/bin/perl')) { + symlink('/usr/local/bin/perl', '/usr/bin/perl'); + } elseif (is_executable(LIGHTSQUID_BASE . '/bin/perl')) { + symlink(LIGHTSQUID_BASE . '/bin/perl', '/usr/bin/perl'); + } + } + if (!is_dir('/usr/local/lib/perl5') && is_dir(LIGHTSQUID_BASE . '/lib/perl5')) { + symlink(LIGHTSQUID_BASE . '/lib/perl5', '/usr/local/lib/perl5'); + } + if (!is_dir('/usr/local/etc/lightsquid') && is_dir(LS_CONFIGPATH)) { + symlink(LS_CONFIGPATH, '/usr/local/etc/lightsquid'); + } + if (!is_dir('/usr/local/www/lightsquid') && is_dir(LS_WWWPATH)) { + symlink(LS_WWWPATH, '/usr/local/www/lightsquid'); + } update_log("lightsquid_install: stopped"); } @@ -436,4 +458,14 @@ function ls_get_real_interface_address($iface) return array($ip, long2ip(hexdec($netmask))); } +/* If a path is a symlink but the target is missing, remove the link. */ +function ls_cleanup_bad_link($link) { + if (file_exists($link) && is_link($link)) { + $target = readlink($link); + if (!file_exists($target) || !is_executable($target)) { + unlink($link); + } + } +} + ?>
\ No newline at end of file diff --git a/config/lightsquid/lightsquid.xml b/config/lightsquid/lightsquid.xml index 8b5b9ae9..0f6baf37 100644 --- a/config/lightsquid/lightsquid.xml +++ b/config/lightsquid/lightsquid.xml @@ -7,7 +7,7 @@ /* $Id$ */ /* ========================================================================== */ /* - authng.xml + lightsquid.xml part of pfSense (http://www.pfSense.com) Copyright (C) 2007 to whom it may belong All rights reserved. @@ -46,7 +46,7 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>lightsquid</name> - <version>1.7.1</version> + <version>1.8.2 pkg v.2.34</version> <title>Services: Proxy Reports (LightSquid, SQStat) -> Settings</title> <category>Status</category> <include_file>/usr/local/pkg/lightsquid.inc</include_file> diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 38b3967c..49344495 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -490,7 +490,7 @@ <descr>High performance web proxy report (LightSquid). Proxy realtime stat (SQStat). Requires squid HTTP proxy.</descr> <website>http://lightsquid.sf.net/</website> <category>Network Report</category> - <version>1.8.2 pkg v.2.33</version> + <version>1.8.2 pkg v.2.34</version> <maintainer>dv_serg@mail.ru</maintainer> <depends_on_package_pbi>lightsquid-1.8_2-##ARCH##.pbi</depends_on_package_pbi> <build_pbi> |