aboutsummaryrefslogtreecommitdiffstats
path: root/config/unbound/unbound_status.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-04-25 17:40:41 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-04-25 17:40:41 -0300
commitd81512d0f0ba39f6badc70acfe7ff6bc1f9bb46e (patch)
tree56f7c2d70542c4d801bfe17acb131480a55bf86d /config/unbound/unbound_status.php
parent439da2334eb58df4bbd50093684e711afd76232f (diff)
downloadpfsense-packages-d81512d0f0ba39f6badc70acfe7ff6bc1f9bb46e.tar.gz
pfsense-packages-d81512d0f0ba39f6badc70acfe7ff6bc1f9bb46e.tar.bz2
pfsense-packages-d81512d0f0ba39f6badc70acfe7ff6bc1f9bb46e.zip
Adjust unbound to wirk with PBI
Make necessary changes on unbound to make it work on pfSense 2.1 using PBI, also, bump version to 1.4.19_02 Fixes #2817
Diffstat (limited to 'config/unbound/unbound_status.php')
-rw-r--r--config/unbound/unbound_status.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/config/unbound/unbound_status.php b/config/unbound/unbound_status.php
index 0a1eae13..d7371f29 100644
--- a/config/unbound/unbound_status.php
+++ b/config/unbound/unbound_status.php
@@ -31,6 +31,12 @@
require("guiconfig.inc");
+// Define basedir constant for unbound according to FreeBSD version (PBI support or no PBI)
+if (floatval(php_uname("r")) >= 8.3)
+ define("UNBOUND_BASE", "/usr/pbi/unbound-" . php_uname("m"));
+else
+ define("UNBOUND_BASE", "/usr/local");
+
if(!is_process_running("unbound")) {
Header("Location: /pkg_edit.php?xml=unbound.xml&id=0");
exit;
@@ -138,7 +144,7 @@ function execCmds() {
<tr>
<td class="tabcont" width="100%">
<?php
- $entries = trim(exec("/usr/local/sbin/unbound-control dump_cache | wc -l"));
+ $entries = trim(exec(UNBOUND_BASE . "/sbin/unbound-control dump_cache | wc -l"));
defCmdT("Unbound status", "unbound-control status", "6");
defCmdT("Unbound stats", "unbound-control stats_noreset");
defCmdT("Unbound stubs", "unbound-control list_stubs", "8");
@@ -146,7 +152,7 @@ function execCmds() {
defCmdT("Unbound local zones", "unbound-control list_local_zones");
defCmdT("Unbound local data", "unbound-control list_local_data");
defCmdT("Unbound cache ($entries entries)", "unbound-control dump_cache", "60");
- defCmdT("Unbound configuration", "/bin/cat /usr/local/etc/unbound/unbound.conf", "60");
+ defCmdT("Unbound configuration", "/bin/cat " . UNBOUND_BASE . "/etc/unbound/unbound.conf", "60");
listCmds();
execCmds();
?>