From 933a34dc77c1afdbcb79dffe66c6a395fb272a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 5 May 2009 23:31:23 +0000 Subject: Remove unused function and function that provide the same functionality as php built-in ones. --- etc/inc/pfsense-utils.inc | 64 ---------------------------------------- usr/local/www/status_slbd_vs.php | 6 ++-- 2 files changed, 4 insertions(+), 66 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 94eae9c..45e1ec5 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -796,70 +796,6 @@ function update_status($status) { } /* - * exec_command_and_return_text_array: execute command and return output - */ -function exec_command_and_return_text_array($command) { - $fd = popen($command . " 2>&1 ", "r"); - while(!feof($fd)) { - $tmp .= fread($fd,49); - } - fclose($fd); - $temp_array = split("\n", $tmp); - return $temp_array; -} - -/* - * exec_command_and_return_text: execute command and return output - */ -function exec_command_and_return_text($command) { - return exec_command($command); -} - -/* - * exec_command_and_return_output: execute command and update output window dynamically - */ -function execute_command_return_output($command) { - global $fd_log, $pkg_interface; - $fd = popen($command . " 2>&1 ", "r"); - if($pkg_interface <> "console") { - echo "\n"; - } - $counter = 0; - $counter2 = 0; - while(!feof($fd)) { - $tmp = fread($fd, 50); - $tmp1 = ereg_replace("\n","\\n", $tmp); - $text = ereg_replace("\"","'", $tmp1); - $lasttext = ""; - if($lasttext == "..") { - $text = ""; - $lasttext = ""; - $counter=$counter-2; - } else { - $lasttext .= $text; - } - if($counter > 51) { - $counter = 0; - $extrabreak = "\\n"; - } else { - $extrabreak = ""; - $counter++; - } - if($counter2 > 600) { - if($pkg_interface <> "console") { - echo "\n"; - } - $counter2 = 0; - } else - $counter2++; - if($pkg_interface <> "console") { - echo "\n"; - } - } - fclose($fd); -} - -/* * update_progress_bar($percent): updates the javascript driven progress bar. */ function update_progress_bar($percent) { diff --git a/usr/local/www/status_slbd_vs.php b/usr/local/www/status_slbd_vs.php index 0f56f32..e888860 100755 --- a/usr/local/www/status_slbd_vs.php +++ b/usr/local/www/status_slbd_vs.php @@ -78,8 +78,10 @@ $a_pool = &$config['load_balancer']['lbpool']; // average: 1/60s 0/h 0/d sessions // 0 redirect testvs active -$redirects_a = exec_command_and_return_text_array('/usr/local/sbin/relayctl show redirects'); -$summary_a = exec_command_and_return_text_array('/usr/local/sbin/relayctl show summary'); +$redirects_a = array(); +exec('/usr/local/sbin/relayctl show redirects 2>&1', $redirects_a); +$summary_a = array(); +exec('/usr/local/sbin/relayctl show summary 2>&1', $summary_a); $rdr_a = parse_redirects($redirects_a); //$server_a = parse_summary($summary_a, parse_redirects($redirects_a)); -- cgit v1.1