aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-11-15 00:00:51 -0600
committerChris Buechler <cmb@pfsense.org>2015-11-15 00:00:51 -0600
commit66364802fc315892631ae882aff5ba4dc515e6d4 (patch)
treec2af620af422a5a2d4d935cbd20d12865bf0e72e /config
parentbb1115e2dfa87c647e8d76124c00944d77708a66 (diff)
parent380a3a1bcddff4bf89416ff5a2230c5ed1c36ecf (diff)
downloadpfsense-packages-66364802fc315892631ae882aff5ba4dc515e6d4.tar.gz
pfsense-packages-66364802fc315892631ae882aff5ba4dc515e6d4.tar.bz2
pfsense-packages-66364802fc315892631ae882aff5ba4dc515e6d4.zip
Merge pull request #1142 from doktornotor/patch-1
Diffstat (limited to 'config')
-rw-r--r--config/ntopng/ntopng.inc22
-rw-r--r--config/ntopng/ntopng.priv.inc37
-rw-r--r--config/ntopng/ntopng.xml6
3 files changed, 55 insertions, 10 deletions
diff --git a/config/ntopng/ntopng.inc b/config/ntopng/ntopng.inc
index 73db1ab0..92b0c5dd 100644
--- a/config/ntopng/ntopng.inc
+++ b/config/ntopng/ntopng.inc
@@ -94,6 +94,14 @@ function ntopng_sync_package() {
$ifaces = "";
$ntopng_config =& $config['installedpackages']['ntopng']['config'][0];
+
+ /* Just stop services and unlink rc script if disabled */
+ if ($ntopng_config['enable'] != "on") {
+ ntopng_services_stop();
+ unlink_if_exists("/usr/local/etc/rc.d/ntopng.sh");
+ return;
+ }
+
foreach ($ntopng_config['interface_array'] as $iface) {
$if = convert_friendly_interface_to_real_interface_name($iface);
if ($if) {
@@ -168,19 +176,15 @@ function ntopng_sync_package() {
/* Set up admin password */
ntopng_set_redis_password();
- /* Restart services if enabled and not booting */
+ /* (Re)start services if not booting */
if ((function_exists("platform_booting")) && (!platform_booting())) {
ntopng_services_stop();
- if ($ntopng_config['enable'] == "on") {
- start_service("ntopng");
- sleep(20);
- }
+ start_service("ntopng");
+ sleep(20);
} elseif (!($g['booting'])) {
ntopng_services_stop();
- if ($ntopng_config['enable'] == "on") {
- start_service("ntopng");
- sleep(20);
- }
+ start_service("ntopng");
+ sleep(20);
}
}
diff --git a/config/ntopng/ntopng.priv.inc b/config/ntopng/ntopng.priv.inc
new file mode 100644
index 00000000..6db26f02
--- /dev/null
+++ b/config/ntopng/ntopng.priv.inc
@@ -0,0 +1,37 @@
+<?php
+/*
+ ntopng.priv.inc
+ part of pfSense (http://www.pfSense.org/)
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+global $priv_list;
+
+$priv_list['page-diagnostics-ntopng'] = array();
+$priv_list['page-diagnostics-ntopng']['name'] = "WebCfg - Diagnostics: ntopng package";
+$priv_list['page-diagnostics-ntopng']['descr'] = "Allow access to ntopng package GUI";
+$priv_list['page-diagnostics-ntopng']['match'] = array();
+$priv_list['page-diagnostics-ntopng']['match'][] = "pkg_edit.php?xml=ntopng.xml*";
+
+?>
diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml
index ee1a4d3e..9cd51aea 100644
--- a/config/ntopng/ntopng.xml
+++ b/config/ntopng/ntopng.xml
@@ -39,13 +39,17 @@
]]>
</copyright>
<name>ntopng</name>
- <version>0.8.0</version>
+ <version>0.8.2</version>
<title>Diagnostics: ntopng Settings</title>
<include_file>/usr/local/pkg/ntopng.inc</include_file>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<item>https://packages.pfsense.org/packages/config/ntopng/ntopng.inc</item>
</additional_files_needed>
+ <additional_files_needed>
+ <prefix>/etc/inc/priv/</prefix>
+ <item>https://packages.pfsense.org/packages/config/ntopng/ntopng.priv.inc</item>
+ </additional_files_needed>
<aftersaveredirect>pkg_edit.php?xml=ntopng.xml</aftersaveredirect>
<menu>
<name>ntopng Settings</name>