Also exclude grep from running processes when grepping for a running packet capture. Also, fix other test to match the recent changes made.

This commit is contained in:
jim-p 2011-04-12 10:04:54 -04:00
parent 127eb8e023
commit d67b6b175c

View File

@ -72,7 +72,7 @@ if ($_POST) {
} elseif ($_POST['stopbtn']!= "") {
$action = gettext("Stop");
$processes_running = trim(shell_exec('/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep '.$fn.' | /usr/bin/grep -v pflog'));
$processes_running = trim(shell_exec("/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep {$fn} | /usr/bin/egrep -v '(pflog|grep)'"));
//explode processes into an array, (delimiter is new line)
$processes_running_array = explode("\n", $processes_running);
@ -194,7 +194,7 @@ include("fbegin.inc");
<?php
/* check to see if packet capture tcpdump is already running */
$processcheck = (trim(shell_exec("/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep {$fn} | /usr/bin/grep -v pflog")));
$processcheck = (trim(shell_exec("/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep {$fn} | /usr/bin/egrep -v '(pflog|grep)'")));
if ($processcheck != "")
$processisrunning = true;