mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Add detect managedModeEnabled state with iwgetid
This commit is contained in:
parent
0d92cb636f
commit
5462e26d95
@ -19,6 +19,7 @@ function DisplayHostAPDConfig()
|
||||
];
|
||||
$arrSecurity = array(1 => 'WPA', 2 => 'WPA2', 3 => 'WPA+WPA2', 'none' => _("None"));
|
||||
$arrEncType = array('TKIP' => 'TKIP', 'CCMP' => 'CCMP', 'TKIP CCMP' => 'TKIP+CCMP');
|
||||
$managedModeEnabled = false;
|
||||
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
|
||||
|
||||
if (isset($_POST['SaveHostAPDSettings'])) {
|
||||
@ -43,6 +44,10 @@ function DisplayHostAPDConfig()
|
||||
|
||||
exec('cat '. RASPI_HOSTAPD_CONFIG, $hostapdconfig);
|
||||
exec('pidof hostapd | wc -l', $hostapdstatus);
|
||||
exec('iwgetid '. RASPI_WIFI_CLIENT_INTERFACE. ' -r', $wifiNetworkID);
|
||||
if ( !empty($wifiNetworkID[0])) {
|
||||
$managedModeEnabled = true;
|
||||
}
|
||||
|
||||
$serviceStatus = $hostapdstatus[0] == 0 ? "down" : "up";
|
||||
|
||||
@ -61,6 +66,7 @@ function DisplayHostAPDConfig()
|
||||
"status",
|
||||
"serviceStatus",
|
||||
"hostapdstatus",
|
||||
"managedModeEnabled",
|
||||
"interfaces",
|
||||
"arrConfig",
|
||||
"arr80211Standard",
|
||||
|
Loading…
Reference in New Issue
Block a user