aboutsummaryrefslogtreecommitdiffstats
path: root/config/openbgpd/openbgpd_status.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/openbgpd/openbgpd_status.php')
-rw-r--r--config/openbgpd/openbgpd_status.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/openbgpd/openbgpd_status.php b/config/openbgpd/openbgpd_status.php
index 68836b21..c7987ec4 100644
--- a/config/openbgpd/openbgpd_status.php
+++ b/config/openbgpd/openbgpd_status.php
@@ -61,8 +61,10 @@ include("head.inc");
function doCmdT($command, $limit = "all", $filter = "", $header_size = 0) {
$grepline = "";
- if (!empty($filter))
- $grepline = " | /usr/bin/grep " . escapeshellarg(htmlspecialchars($filter));
+ if (!empty($filter)) {
+ $ini = ($header_size > 0 ? $header_size+1 : 1);
+ $grepline = " | /usr/bin/sed -e '{$ini},\$ { /" . escapeshellarg(htmlspecialchars($filter)) . "/!d; };'";
+ }
if (is_numeric($limit) && $limit > 0) {
$limit += $header_size;
$headline = " | /usr/bin/head -n {$limit}";