mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 15:10:22 +00:00
Update parsing of dhcp-range
This commit is contained in:
parent
0610848a25
commit
3f11ac165b
1 changed files with 5 additions and 2 deletions
|
@ -11,7 +11,11 @@ if (isset($interface)) {
|
|||
$conf = ParseConfig($return);
|
||||
|
||||
$dhcpdata['DHCPEnabled'] = empty($conf) ? false : true;
|
||||
$arrRange = explode(",", $conf['dhcp-range'][0]);
|
||||
if (is_string($conf['dhcp-range'])) {
|
||||
$arrRange = explode(",", $conf['dhcp-range']);
|
||||
} else {
|
||||
$arrRange = explode(",", $conf['dhcp-range'][0]);
|
||||
}
|
||||
$dhcpdata['RangeStart'] = $arrRange[0];
|
||||
$dhcpdata['RangeEnd'] = $arrRange[1];
|
||||
$dhcpdata['RangeMask'] = $arrRange[2];
|
||||
|
@ -55,6 +59,5 @@ if (isset($interface)) {
|
|||
$dhcpdata['FallbackEnabled'] = empty($fallback) ? false: true;
|
||||
$dhcpdata['DefaultRoute'] = $gateway[0] == "gateway";
|
||||
$dhcpdata['NoHookWPASupplicant'] = $nohook_wpa_supplicant[0] == "nohook wpa_supplicant";
|
||||
|
||||
echo json_encode($dhcpdata);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue