diff options
author | Chris Buechler <cmb@pfsense.org> | 2013-01-30 00:41:15 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2013-01-30 00:41:15 -0800 |
commit | 6796d0d10c8066e5790b75ec074e2a1dd4f5bd12 (patch) | |
tree | 7ab69f20067e0a183a57c138fcb3fd736600e550 | |
parent | a526f6a9b8d0c4b570e0f2f81bbdf04d2541b05b (diff) | |
parent | 97f3ce0fa120bb7d963dcd0be426bc1e66679721 (diff) | |
download | pfsense-6796d0d10c8066e5790b75ec074e2a1dd4f5bd12.zip pfsense-6796d0d10c8066e5790b75ec074e2a1dd4f5bd12.tar.gz |
Merge pull request #361 from phil-davis/master
Corrected cmd line for hostapd
-rw-r--r-- | etc/inc/interfaces.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a2a5f58..46e68e8 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'])) { - mwexec(kill_hostapd($realif)); + kill_hostapd($realif); mwexec(kill_wpasupplicant($realif)); } @@ -2373,7 +2373,7 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) { $wlcmd[] = "authmode open wepmode off "; } - mwexec(kill_hostapd("{$if}")); + 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\n"); + fwrite($fd_set, "{$hostapd} -B -P {$g['varrun_path']}/hostapd_{$if}.pid {$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,7 +2624,10 @@ EOD; } function kill_hostapd($interface) { - return "/bin/pkill -f \"hostapd .*{$interface}\"\n"; + global $g; + + if (isvalidpid("{$g['varrun_path']}/hostapd_{$interface}.pid")) + return killbypid("{$g['varrun_path']}/hostapd_{$interface}.pid"); } function kill_wpasupplicant($interface) { |