diff options
author | Ermal <eri@pfsense.org> | 2013-01-30 07:48:16 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-01-30 07:48:16 +0000 |
commit | 6d33b044a9bedd986dcb7c58218e325918635b5d (patch) | |
tree | ab78a82708c09afc7ff023d987d5d24901037804 | |
parent | 3fe15891fc0a408b688eb0accd97bbf3e4f6b196 (diff) | |
download | pfsense-6d33b044a9bedd986dcb7c58218e325918635b5d.zip pfsense-6d33b044a9bedd986dcb7c58218e325918635b5d.tar.gz |
Revert "Use pid even for hostapd rather then trying to guess with regex"
This reverts commit b73a96b68d1d4e919a268d2e8e3a6ec902709e6d.
-rw-r--r-- | etc/inc/interfaces.inc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a39f8cb..a2a5f58 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1203,7 +1203,7 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = /* hostapd and wpa_supplicant do not need to be running when the interface is down. * They will also use 100% CPU if running after the wireless clone gets deleted. */ if (is_array($ifcfg['wireless'])) { - kill_hostapd($realif); + mwexec(kill_hostapd($realif)); mwexec(kill_wpasupplicant($realif)); } @@ -2373,7 +2373,7 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) { $wlcmd[] = "authmode open wepmode off "; } - kill_hostapd($if); + mwexec(kill_hostapd("{$if}")); mwexec(kill_wpasupplicant("{$if}")); /* generate wpa_supplicant/hostap config if wpa is enabled */ @@ -2509,7 +2509,7 @@ EOD; " link " . escapeshellarg($if_oldmac) . "\n"); } - fwrite($fd_set, "{$hostapd} -B {$g['varetc_path']}/hostapd_{$if}.conf -P {$g['varrun_path']}/hostapd_{$if}.pid\n"); + fwrite($fd_set, "{$hostapd} -B {$g['varetc_path']}/hostapd_{$if}.conf\n"); /* add line to script to restore spoofed mac after running hostapd */ if (file_exists("{$g['tmp_path']}/{$if}_oldmac")) { @@ -2624,10 +2624,7 @@ EOD; } function kill_hostapd($interface) { - global $g; - - if (isvalidpid("{$g['varrun_path']}/hostapd_{$interface}.pid")) - return killbypid("{$g['varrun_path']}/hostapd_{$interface}.pid"); + return "/bin/pkill -f \"hostapd .*{$interface}\"\n"; } function kill_wpasupplicant($interface) { |