From 3221116df2a569884ffadda1e69638c2dc55da43 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 16 Sep 2015 22:50:19 +0200 Subject: ntopng - fix up 2.1.x vs. 2.2.x PBI mess Argh! I hate the PBI thing with passion! Die! --- config/ntopng/ntopng.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'config/ntopng') diff --git a/config/ntopng/ntopng.inc b/config/ntopng/ntopng.inc index 55553241..73db1ab0 100644 --- a/config/ntopng/ntopng.inc +++ b/config/ntopng/ntopng.inc @@ -151,8 +151,10 @@ function ntopng_sync_package() { $start = ""; $stop = ""; - if ($pf_version == "2.1" || $pf_version == "2.2") { - $start .= "ldconfig -m /usr/pbi/ntopng-" . php_uname("m") . "/lib\n"; + if ($pf_version == "2.2") { + $start .= "/sbin/ldconfig -m /usr/pbi/ntopng-" . php_uname("m") . "/local/lib\n"; + } elseif ($pf_version == "2.1") { + $start .= "/sbin/ldconfig -m /usr/pbi/ntopng-" . php_uname("m") . "/lib\n"; } $start .= "\t{$redis_path}/redis-server --dir /var/db/ntopng/ --dbfilename ntopng.rdb &\n"; // TODO: @@ -206,7 +208,9 @@ function ntopng_redis_started() { $redis_path = "/usr/local/bin"; } if (!is_process_running("redis-server")) { - if ($pf_version == "2.1" || $pf_version == "2.2") { + if ($pf_version == "2.2") { + mwexec("/sbin/ldconfig -m /usr/pbi/ntopng-" . php_uname("m") . "/local/lib"); + } elseif ($pf_version == "2.1") { mwexec("/sbin/ldconfig -m /usr/pbi/ntopng-" . php_uname("m") . "/lib"); } mwexec_bg("{$redis_path}/redis-server --dir /var/db/ntopng/ --dbfilename ntopng.rdb"); @@ -260,7 +264,9 @@ function ntopng_update_geoip() { $geoip_asnum = "https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz"; $geoip_asnum_v6 = "https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz"; $pf_version = substr(trim(file_get_contents("/etc/version")), 0, 3); - if ($pf_version == "2.1" || $pf_version == "2.2") { + if ($pf_version == "2.2") { + $output_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/local/share/ntopng"; + } elseif ($pf_version == "2.1") { $output_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/share/ntopng"; } else { $output_dir = "/usr/local/share/ntopng"; @@ -285,8 +291,11 @@ function ntopng_update_geoip() { function ntopng_fixup_geoip() { $pf_version = substr(trim(file_get_contents("/etc/version")), 0, 3); - if ($pf_version == "2.1" || $pf_version == "2.2") { + if ($pf_version == "2.2") { $target_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/local/share/ntopng/httpdocs/geoip"; + $source_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/local/share/ntopng"; + } elseif ($pf_version == "2.1") { + $target_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/share/ntopng/httpdocs/geoip"; $source_dir = "/usr/pbi/ntopng-" . php_uname("m") . "/share/ntopng"; } else { $target_dir = "/usr/local/share/ntopng/httpdocs/geoip"; -- cgit v1.2.3