diff --git a/includes/wifi_functions.php b/includes/wifi_functions.php index 8296c57c..a241fa02 100755 --- a/includes/wifi_functions.php +++ b/includes/wifi_functions.php @@ -157,3 +157,18 @@ function getWifiInterface() } } +/* + * Reinitializes wpa_supplicant for the wifi client interface + * + * @param boolean $force + */ +function reinitializeWPA($force) +{ + if ($force == true) { + $cmd = escapeshellcmd("/bin/rm /var/run/wpa_supplicant/".$_SESSION['wifi_client_interface']); + $result = exec($cmd); + } + $cmd = escapeshellcmd("sudo /sbin/wpa_supplicant -B -Dnl80211 -Dwext c/etc/wpa_supplicant/wpa_supplicant.conf -i". $_SESSION['wifi_client_interface']); + $result = shell_exec($cmd); + return $result; +}