mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Fetch br0 properties with $dhcpcd->getInterfaceConfig
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use RaspAP\Networking\Hotspot\HostapdManager;
|
||||
use RaspAP\Networking\Hotspot\HotspotService;
|
||||
use RaspAP\Networking\Hotspot\WiFiManager;
|
||||
use RaspAP\Networking\Hotspot\DhcpcdManager;
|
||||
use RaspAP\Messages\StatusMessage;
|
||||
use RaspAP\System\Sysinfo;
|
||||
|
||||
@@ -18,6 +19,7 @@ function DisplayHostAPDConfig()
|
||||
$hostapd = new HostapdManager();
|
||||
$hotspot = new HotspotService();
|
||||
$status = new StatusMessage();
|
||||
$dhcpcd = new DhcpcdManager();
|
||||
$system = new Sysinfo();
|
||||
$operatingSystem = $system->operatingSystem();
|
||||
|
||||
@@ -104,6 +106,30 @@ function DisplayHostAPDConfig()
|
||||
error_log('Error: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// bridge configuration
|
||||
if (!empty($arrHostapdConf['BridgedEnable']) && (int)$arrHostapdConf['BridgedEnable'] === 1) {
|
||||
$iface = 'br0';
|
||||
$bridgeConfig = $dhcpcd->getInterfaceConfig($iface);
|
||||
|
||||
if (is_array($bridgeConfig) && !empty($bridgeConfig)) {
|
||||
$arrConfig['bridgeStaticIP'] = !empty($bridgeConfig['StaticIP'])
|
||||
? $bridgeConfig['StaticIP']
|
||||
: '192.168.1.10';
|
||||
|
||||
$arrConfig['bridgeNetmask'] = !empty($bridgeConfig['SubnetMask'])
|
||||
? mask2cidr($bridgeConfig['SubnetMask'])
|
||||
: '24';
|
||||
|
||||
$arrConfig['bridgeGateway'] = !empty($bridgeConfig['StaticRouters'])
|
||||
? $bridgeConfig['StaticRouters']
|
||||
: '192.168.1.1';
|
||||
|
||||
$arrConfig['bridgeDNS'] = !empty($bridgeConfig['StaticDNS'])
|
||||
? $bridgeConfig['StaticDNS']
|
||||
: '192.168.1.1';
|
||||
}
|
||||
}
|
||||
|
||||
// assign disassoc_low_ack boolean if value is set
|
||||
$arrConfig['disassoc_low_ack_bool'] = isset($arrConfig['disassoc_low_ack']) ? 1 : 0;
|
||||
$hostapdstatus = $system->hostapdStatus();
|
||||
|
||||
Reference in New Issue
Block a user