Create reinitializeWPA()

This commit is contained in:
Bill Zimmerman 2021-04-29 23:58:46 +02:00 committed by GitHub
parent c8a9c05d3e
commit 3451efe132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}