Do not killall all hostpad or wpa_supplicant processes. This is NOT multi interface friendly.

Instead look for the process with the interface in it and kill the correct one.
This commit is contained in:
Scott Ullrich 2006-06-01 01:58:33 +00:00
parent b76fd87feb
commit 4b2a618018

View File

@ -606,7 +606,7 @@ EOD;
fwrite($fd, "{$wpa}");
fclose($fd);
fwrite($fd_set, "{$killall} wpa_supplicant\n");
kill_wpasupplicant($if);
}
break;
@ -645,13 +645,13 @@ EOD;
fwrite($fd, "{$wpa}");
fclose($fd);
fwrite($fd_set, "{$killall} hostapd\n");
kill_hostapd($if);
}
break;
case 'adhoc':
fwrite($fd_set, "{$killall} hostapd\n");
fwrite($fd_set, "{$killall} wpa_supplicant\n");
kill_hostapd($if);
kill_wpasupplicant($if);
break;
}
@ -709,6 +709,14 @@ EOD;
}
function kill_hostapd($interface) {
mwexec("/bin/ps awwuxx | grep hostatpd | grep $interface | awk '{ print \$2 }' | xargs kill");
}
function kill_wpasupplicant($interface) {
mwexec("/bin/ps awwuxx | grep wpa_supplicant | grep $interface | awk '{ print \$2 }' | xargs kill");
}
function find_dhclient_process($interface) {
if(filter_translate_type_to_real_interface($interface) <> "")
$realinterface = filter_translate_type_to_real_interface($interface);