mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Add status msg, update shell cmds
This commit is contained in:
parent
79393c48d0
commit
8873735d7f
2 changed files with 5 additions and 3 deletions
|
@ -20,6 +20,7 @@ function DisplayWPAConfig()
|
|||
exec('sudo wpa_cli -i ' . $_SESSION['wifi_client_interface'] . ' select_network '.strval($_POST['connect']));
|
||||
$status->addMessage('New network selected', 'success');
|
||||
} elseif (isset($_POST['wpa_reinit'])) {
|
||||
$status->addMessage('Re-initializing wpa_supplicant', 'info', false);
|
||||
$force_remove=true;
|
||||
$result = reinitializeWPA($force_remove);
|
||||
$status->addMessage($result, 'info');
|
||||
|
|
|
@ -165,10 +165,11 @@ function getWifiInterface()
|
|||
function reinitializeWPA($force)
|
||||
{
|
||||
if ($force == true) {
|
||||
$cmd = escapeshellcmd("/bin/rm /var/run/wpa_supplicant/".$_SESSION['wifi_client_interface']);
|
||||
$result = exec($cmd);
|
||||
$cmd = escapeshellcmd("sudo /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']);
|
||||
$cmd = escapeshellcmd("sudo /sbin/wpa_supplicant -B -Dnl80211 -c/etc/wpa_supplicant/wpa_supplicant.conf -i". $_SESSION['wifi_client_interface']);
|
||||
$result = shell_exec($cmd);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue