if ($scan->getPID() != 0 && $scan->getStatus() == 1) { $scan->setStatus(2); system("sudo kill " . $scan->getPID()); header('Location: apview.php?parent_scan=' . $_GET['parent_scan'] . '&scanid=' . $_GET['scanid'] . '&bssid=' . $_GET['bssid']); die; } } else { if ($_GET['do'] == "terminatenstart") { // Terminate parent scan $previous = Scan::fromDB($_GET['parent_scan']); if ($previous->getPID() != 0 && $previous->getStatus() == 1) { $previous->setStatus(2); system("sudo kill " . $previous->getPID()); } // Start new individual scan $scan = Scan::newScan(); $scan->setStatus(1); $scan->startIndScan($parent_ap->getBSSID(), $parent_ap->getChannel()); $parent_ap->setIndScanID($scan->getID()); header('Location: apview.php?parent_scan=' . $_GET['parent_scan'] . '&scanid=' . $scan->getID() . '&bssid=' . $_GET['bssid']); die; } else { if ($_GET['do'] == "deauth") { $wicker->deauth($_GET['bssid'], $_GET['deauthmac'], "scans/" . $ind_scan->getGUID() . ".log"); } else { if ($_GET['do'] == "deauthbroadcast") { $wicker->deauth($_GET['bssid'], null, "scans/" . $ind_scan->getGUID() . ".log"); } else { if ($_GET['do'] == "associate") { $wicker->associate($_GET['bssid'], "scans/" . $ind_scan->getGUID() . ".log"); } else {