From 99e72ce8784ebc3d1f9ee93a01697b76771ec787 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 5 Jun 2006 00:13:29 +0000 Subject: [PATCH] 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. --- etc/inc/interfaces.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index c7e9edbf11..495b5dc6eb 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -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) {