aboutsummaryrefslogtreecommitdiffstats
path: root/config/openbgpd
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-07-23 21:31:41 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-07-23 21:31:41 -0300
commit60b1fbe6af66e1ae493e862d632c356b016ce0e6 (patch)
treebe9f7b9c2b3a320eee0a79bc4f8780d9c7322759 /config/openbgpd
parent507085cad59921b7975d0a1b228248486bdc9cfb (diff)
downloadpfsense-packages-60b1fbe6af66e1ae493e862d632c356b016ce0e6.tar.gz
pfsense-packages-60b1fbe6af66e1ae493e862d632c356b016ce0e6.tar.bz2
pfsense-packages-60b1fbe6af66e1ae493e862d632c356b016ce0e6.zip
Remove format piece of doCmdT and move them to showCmdT
Diffstat (limited to 'config/openbgpd')
-rw-r--r--config/openbgpd/openbgpd_status.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/config/openbgpd/openbgpd_status.php b/config/openbgpd/openbgpd_status.php
index 1cbcc842..dabcd605 100644
--- a/config/openbgpd/openbgpd_status.php
+++ b/config/openbgpd/openbgpd_status.php
@@ -37,23 +37,29 @@ else
include("head.inc");
-function doCmdT($title, $command) {
- echo "<p>\n";
- echo "<a name=\"" . $title . "\">&nbsp;</a>\n";
- echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
- echo "<tr><td class=\"listtopic\">" . $title . "</td></tr>\n";
- echo "<tr><td class=\"listlr\"><pre>"; /* no newline after pre */
-
+function doCmdT($command) {
$fd = popen("{$command} 2>&1", "r");
$ct = 0;
+ $result = "";
while (($line = fgets($fd)) !== FALSE) {
- echo htmlspecialchars($line, ENT_NOQUOTES);
+ $result .= htmlspecialchars($line, ENT_NOQUOTES);
if ($ct++ > 1000) {
ob_flush();
$ct = 0;
}
}
pclose($fd);
+
+ return $result;
+}
+
+function showCmdT($title, $command) {
+ echo "<p>\n";
+ echo "<a name=\"" . $title . "\">&nbsp;</a>\n";
+ echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
+ echo "<tr><td class=\"listtopic\">" . $title . "</td></tr>\n";
+ echo "<tr><td class=\"listlr\"><pre>"; /* no newline after pre */
+ echo doCmdT($command);
echo "</pre></td></tr>\n";
echo "</table>\n";
}
@@ -79,7 +85,7 @@ function listCmds() {
function execCmds() {
global $commands;
foreach ($commands as $command)
- doCmdT($command[0], $command[1]);
+ showCmdT($command[0], $command[1]);
}
?>