mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Get hostapdStatus from System
This commit is contained in:
parent
1bbeefca7c
commit
2056236c42
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include_once('includes/status_messages.php');
|
include_once('includes/status_messages.php');
|
||||||
|
include_once('app/lib/system.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -9,6 +10,7 @@ include_once('includes/status_messages.php');
|
|||||||
function DisplayHostAPDConfig()
|
function DisplayHostAPDConfig()
|
||||||
{
|
{
|
||||||
$status = new StatusMessages();
|
$status = new StatusMessages();
|
||||||
|
$system = new System();
|
||||||
$arrHostapdConf = parse_ini_file('/etc/raspap/hostapd.ini');
|
$arrHostapdConf = parse_ini_file('/etc/raspap/hostapd.ini');
|
||||||
$arrConfig = array();
|
$arrConfig = array();
|
||||||
$arr80211Standard = [
|
$arr80211Standard = [
|
||||||
@ -44,12 +46,11 @@ function DisplayHostAPDConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
exec('cat '. RASPI_HOSTAPD_CONFIG, $hostapdconfig);
|
exec('cat '. RASPI_HOSTAPD_CONFIG, $hostapdconfig);
|
||||||
exec('pidof hostapd | wc -l', $hostapdstatus);
|
|
||||||
exec('iwgetid '. RASPI_WIFI_CLIENT_INTERFACE. ' -r', $wifiNetworkID);
|
exec('iwgetid '. RASPI_WIFI_CLIENT_INTERFACE. ' -r', $wifiNetworkID);
|
||||||
if ( !empty($wifiNetworkID[0])) {
|
if ( !empty($wifiNetworkID[0])) {
|
||||||
$managedModeEnabled = true;
|
$managedModeEnabled = true;
|
||||||
}
|
}
|
||||||
|
$hostapdstatus = $system->hostapdStatus();
|
||||||
$serviceStatus = $hostapdstatus[0] == 0 ? "down" : "up";
|
$serviceStatus = $hostapdstatus[0] == 0 ? "down" : "up";
|
||||||
|
|
||||||
foreach ($hostapdconfig as $hostapdconfigline) {
|
foreach ($hostapdconfig as $hostapdconfigline) {
|
||||||
|
Loading…
Reference in New Issue
Block a user