diff options
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 04ab574..f6bbaaa 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2257,7 +2257,7 @@ EOD; fwrite($fd_set, "{$wpa_supplicant} -B -i {$if} -c {$g['varetc_path']}/wpa_supplicant_{$if}.conf\n"); } if ($wlcfg['mode'] == "hostap") { - /* restore old mac to make hostapd happy */ + /* add line to script to restore old mac to make hostapd happy */ if (file_exists("{$g['tmp_path']}/{$if}_oldmac")) { $if_oldmac = file_get_contents("{$g['tmp_path']}/{$if}_oldmac"); if (is_macaddr($if_oldmac)) @@ -2266,6 +2266,17 @@ EOD; } 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")) { + if ($wl['spoofmac']) + $if_curmac = $wl['spoofmac']; + else + $if_curmac = get_interface_mac($if); + if (is_macaddr($if_curmac)) + fwrite($fd_set, "{$ifconfig} " . escapeshellarg($if) . + " link " . escapeshellarg($if_curmac) . "\n"); + } } } |