From a0554e985938c4fb0046966b4af9f01a70c6d882 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Wed, 21 Dec 2016 16:39:36 -0500 Subject: [PATCH 1/3] Handle no IPv4 address when guessing initial DHCP --- settings.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/settings.php b/settings.php index 6f404552..90abc485 100644 --- a/settings.php +++ b/settings.php @@ -106,10 +106,17 @@ { $DHCP = false; // Try to guess initial settings - $DHCPdomain = explode(".",$piHoleIPv4); - $DHCPstart = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".201"; - $DHCPend = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".251"; - $DHCProuter = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".1"; + if($piHOleIPv4 !== "unknown") { + $DHCPdomain = explode(".",$piHoleIPv4); + $DHCPstart = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".201"; + $DHCPend = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".251"; + $DHCProuter = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".1"; + } + else { + $DHCPstart = "0.0.0.0"; + $DHCPend = "0.0.0.0"; + $DHCProuter = "0.0.0.0"; + } } if(isset($setupVars["PIHOLE_DOMAIN"])){ $piHoleDomain = $setupVars["PIHOLE_DOMAIN"]; From 688f7dd5c75d979d6f8290a87d9803fe0ad5c862 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Wed, 21 Dec 2016 17:53:46 -0500 Subject: [PATCH 2/3] Fix typo --- settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.php b/settings.php index 90abc485..4d0a7f4b 100644 --- a/settings.php +++ b/settings.php @@ -106,7 +106,7 @@ { $DHCP = false; // Try to guess initial settings - if($piHOleIPv4 !== "unknown") { + if($piHoleIPv4 !== "unknown") { $DHCPdomain = explode(".",$piHoleIPv4); $DHCPstart = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".201"; $DHCPend = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".251"; From 765db730b6031ddf63b0178581b275cb1ec08023 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 21 Dec 2016 23:59:01 +0100 Subject: [PATCH 3/3] Empty suggestion instead of 0.0.0.0 --- settings.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/settings.php b/settings.php index 4d0a7f4b..2ae032ea 100644 --- a/settings.php +++ b/settings.php @@ -113,9 +113,9 @@ $DHCProuter = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".1"; } else { - $DHCPstart = "0.0.0.0"; - $DHCPend = "0.0.0.0"; - $DHCProuter = "0.0.0.0"; + $DHCPstart = ""; + $DHCPend = ""; + $DHCProuter = ""; } } if(isset($setupVars["PIHOLE_DOMAIN"])){