Restore evil ugly hacks that was there before me without being even more evil by calling killall.

This code is wacked and really needs fixing in HEAD.  I'll leave it broken to entice someone to fix it the correct way soon.
This commit is contained in:
Scott Ullrich 2006-06-05 00:13:29 +00:00
parent 8d80974785
commit 99e72ce878

View File

@ -606,7 +606,7 @@ EOD;
fwrite($fd, "{$wpa}");
fclose($fd);
kill_wpasupplicant($if);
fwrite($fd_set, kill_wpasupplicant($if));
}
break;
@ -645,13 +645,13 @@ EOD;
fwrite($fd, "{$wpa}");
fclose($fd);
kill_hostapd($if);
fwrite($fd_set, kill_hostapd($if));
}
break;
case 'adhoc':
kill_hostapd($if);
kill_wpasupplicant($if);
fwrite($fd_set, kill_hostapd($if));
fwrite($fd_set, kill_wpasupplicant($if));
break;
}
@ -702,7 +702,7 @@ EOD;
/* execute commands now in shell */
mwexec("/bin/sh /tmp/{$if}_setup.sh");
sleep(1);
sleep(2);
mwexec("/bin/sh /tmp/{$if}_setup.sh");
return 0;
@ -710,11 +710,11 @@ EOD;
}
function kill_hostapd($interface) {
mwexec("/bin/ps awwuxx | grep hostapd | grep $interface | awk '{ print \$2 }' | xargs kill");
return "/bin/ps awwuxx | grep hostapd | grep $interface | awk '{ print \$2 }' | xargs kill\n";
}
function kill_wpasupplicant($interface) {
mwexec("/bin/ps awwuxx | grep wpa_supplicant | grep $interface | awk '{ print \$2 }' | xargs kill");
return "/bin/ps awwuxx | grep wpa_supplicant | grep $interface | awk '{ print \$2 }' | xargs kill\n";
}
function find_dhclient_process($interface) {