summaryrefslogtreecommitdiffstats
path: root/etc/ecl.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-11-28 17:17:21 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-11-28 17:17:21 -0500
commit651a6867747e5bda9e8d5148ee5a710c5c706691 (patch)
tree49375a69f8a19e3d61cc35fb7f9f17c9248fc8d7 /etc/ecl.php
parent6edc4c0c5ce0d3ffb2746611a4ca569ad48cd343 (diff)
downloadpfsense-651a6867747e5bda9e8d5148ee5a710c5c706691.zip
pfsense-651a6867747e5bda9e8d5148ee5a710c5c706691.tar.gz
Use head binary and eliminate a pipe to avoid broken pipe warning
Diffstat (limited to 'etc/ecl.php')
-rwxr-xr-xetc/ecl.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/ecl.php b/etc/ecl.php
index c0424ef..8edc3bc 100755
--- a/etc/ecl.php
+++ b/etc/ecl.php
@@ -82,9 +82,11 @@ function discover_config($mountpoint) {
function test_config($file_location) {
global $g, $debug;
+ if(!$file_location)
+ return;
// config.xml was found. ensure it is sound.
$root_obj = trim("<{$g['xml_rootobj']}>");
- $xml_file_head = trim(`/bin/cat {$file_location} | /usr/bin/head -n2 | /usr/bin/tail -n1`);
+ $xml_file_head = exec("/usr/bin/head -2 {$file_location} | /usr/bin/tail -n1");
if($debug) {
echo "\nroot obj = $root_obj";
echo "\nfile head = $xml_file_head";
@@ -125,7 +127,6 @@ function find_config_xml() {
if($debug)
echo "\nmounted: $mounted ";
if(intval($mounted) > 0) {
- echo " ! ";
// Item was mounted - look for config.xml file
$config_location = discover_config($slice);
if($config_location) {
OpenPOWER on IntegriCloud