summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-11-10 19:34:24 +0000
committerErmal <eri@pfsense.org>2010-11-10 19:34:24 +0000
commitb06d7ebb1d1d6468b180ddf24376c3f1063de625 (patch)
tree0bb3d8cce85a498a4cf13ca4f8617a602305b13a
parent35d26b25a179e02745e22875a31d0465f48a8b9e (diff)
downloadpfsense-b06d7ebb1d1d6468b180ddf24376c3f1063de625.zip
pfsense-b06d7ebb1d1d6468b180ddf24376c3f1063de625.tar.gz
Use exec and check return value of command to avoid priting messages of stderr to console.
-rw-r--r--etc/inc/filter.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index d1bc904..71030d6 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -126,9 +126,9 @@ function filter_pflog_start() {
echo "filter_pflog_start() being called $mt\n";
}
mute_kernel_msgs();
- $pid = 0;
- $pid = `/bin/pgrep -f "tcpdump -s 256 -v -l -n -e -ttt -i pflog0"`;
- if(!$pid)
+ $output = 0;
+ exec("/bin/pgrep -f 'tcpdump -s 256 -v -l -n -e -ttt -i pflog0'", $output, $retval);
+ if($retval != 0)
mwexec_bg("/usr/sbin/tcpdump -s 256 -v -l -n -e -ttt -i pflog0 | logger -t pf -p local0.info");
unmute_kernel_msgs();
}
@@ -2723,4 +2723,4 @@ function discover_pkg_rules($ruletype) {
// vim: ts=4 sw=4 noexpandtab
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud