fix(yeswiki-installer) : DNS entries for ip4 and 6

This commit is contained in:
mrflos 2023-04-21 07:39:00 +03:00
parent 792e4489ff
commit 30c9718ad4

View file

@ -11,9 +11,15 @@ function checkDNS($domain, $withWww = false)
if (empty($currentip)) { if (empty($currentip)) {
throw new Exception('the domain '.$domain.' was not found in DNS record.'); throw new Exception('the domain '.$domain.' was not found in DNS record.');
} }
if (empty($currentip[0]['ip'])) {
throw new Exception('the domain '.$domain.' has no ip v4 in DNS record.');
}
if ($currentip[0]['ip'] !== $_SERVER['ip4']) { if ($currentip[0]['ip'] !== $_SERVER['ip4']) {
throw new Exception('the current ip v4 address of '.$domain.' is '.$currentip[0]['ip'].'. it should be '.$_SERVER['ip4']); throw new Exception('the current ip v4 address of '.$domain.' is '.$currentip[0]['ip'].'. it should be '.$_SERVER['ip4']);
} }
if (empty($currentip[0]['ipv6'])) {
throw new Exception('the domain '.$domain.' has no ip v6 in DNS record.');
}
if ($currentip[1]['ipv6'] !== $_SERVER['ip6']) { if ($currentip[1]['ipv6'] !== $_SERVER['ip6']) {
throw new Exception('the current ip v6 address of '.$domain.' is '.$currentip[1]['ipv6'].'. it should be '.$_SERVER['ip6']); throw new Exception('the current ip v6 address of '.$domain.' is '.$currentip[1]['ipv6'].'. it should be '.$_SERVER['ip6']);
} }