finished check:domains
Signed-off-by: tracer <tracer@24unix.net>
This commit is contained in:
parent
a3b8de848e
commit
bf9c98e6e7
|
@ -144,8 +144,8 @@ class BindAPI
|
|||
echo COLOR_YELLOW . "check" . COLOR_DEFAULT . "\t health checks the system can perform" . PHP_EOL;
|
||||
echo COLOR_GREEN . "\t check:permissions" . PHP_EOL;
|
||||
echo COLOR_GREEN . "\t check:panels {ID} {fix=yes}" . PHP_EOL;
|
||||
echo COLOR_GREEN . "\t check:domains {ID} {fix=yes}" . PHP_EOL;
|
||||
echo COLOR_GREEN . "\t check:showinclude" . COLOR_DEFAULT . " Temporary needed until KeyHelp 22.1" . PHP_EOL;
|
||||
echo COLOR_GREEN . "\t check:domains" . PHP_EOL;
|
||||
echo COLOR_GREEN . "\t check:showincludes" . COLOR_DEFAULT . " Temporary needed until KeyHelp 22.1" . PHP_EOL;
|
||||
|
||||
|
||||
echo COLOR_YELLOW . "panels" . COLOR_DEFAULT . "\t all Keyhelp systems configured" . PHP_EOL;
|
||||
|
@ -187,7 +187,8 @@ class BindAPI
|
|||
match ($subcommand) {
|
||||
'permissions' => $this->handleCheckPermissions(),
|
||||
'panels' => $this->handleCheckPanels(),
|
||||
'showincludes' => $this->showIncludes(),
|
||||
'domains' => $this->handleCheckDomains(),
|
||||
'showincludes' => $this->handleCheckShowIncludes(),
|
||||
};
|
||||
} catch (UnhandledMatchError) {
|
||||
echo 'Unknown action: ' . $subcommand . PHP_EOL;
|
||||
|
@ -343,12 +344,7 @@ class BindAPI
|
|||
foreach ($domains as $domain) {
|
||||
if ($this->isValidSecondLevelDomain(domainName: $domain->domain, panel: $panel->getName(), parent: $domain->id_parent_domain)) {
|
||||
echo COLOR_DEFAULT . " Domain: " . COLOR_YELLOW . str_pad(string: $domain->domain, length: $maxDomainName);
|
||||
try {
|
||||
$this->checkNS(domainName: $domain->domain, panel: $panel);
|
||||
} catch (DependencyException|NotFoundException $e) {
|
||||
print($e->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
$this->checkNS(domainName: $domain->domain, panel: $panel);
|
||||
$domainCount++;
|
||||
}
|
||||
}
|
||||
|
@ -392,8 +388,6 @@ class BindAPI
|
|||
* @param \App\Entity\Panel $panel
|
||||
*
|
||||
* @return void
|
||||
* @throws \DI\DependencyException
|
||||
* @throws \DI\NotFoundException
|
||||
*/
|
||||
function checkNS(string $domainName, Panel $panel)
|
||||
{
|
||||
|
@ -447,8 +441,8 @@ class BindAPI
|
|||
if (!empty($arguments['fix']) && $arguments['fix'] == 'yes') {
|
||||
echo ' trying to fix …';
|
||||
$body = [
|
||||
'name' => $domainName,
|
||||
'panel' => $panel->getName(),
|
||||
'name' => $domainName,
|
||||
'panel' => $panel->getName(),
|
||||
];
|
||||
try {
|
||||
if (!empty($nameServer->getAaaa())) {
|
||||
|
@ -1068,9 +1062,7 @@ class BindAPI
|
|||
echo "Domain: $name already exists." . PHP_EOL;
|
||||
exit(1);
|
||||
} else {
|
||||
if ($this->panelRepository->findByName(name: $panel)) {
|
||||
$content = $this->domainController->createPanelContent(panel: $panel);
|
||||
} else {
|
||||
if (!$this->panelRepository->findByName(name: $panel)) {
|
||||
echo 'Unknown panel: ' . $panel;
|
||||
exit(1);
|
||||
}
|
||||
|
@ -1106,8 +1098,6 @@ class BindAPI
|
|||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
$content = [];
|
||||
if (!empty($panelName)) {
|
||||
$panel = $this->panelRepository->findByName(name: $panelName);
|
||||
}
|
||||
|
@ -1322,7 +1312,7 @@ class BindAPI
|
|||
* @throws \DI\DependencyException
|
||||
* @throws \DI\NotFoundException
|
||||
*/
|
||||
private function showIncludes()
|
||||
function handleCheckShowIncludes()
|
||||
{
|
||||
$nameservers = $this->nameserverRepository->findAll();
|
||||
|
||||
|
@ -1348,4 +1338,13 @@ class BindAPI
|
|||
echo PHP_EOL . 'After the modification feel free to run ' . COLOR_YELLOW . 'named-checkconf' . COLOR_DEFAULT . ' to ensure there were no errors.' . PHP_EOL;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \DI\DependencyException
|
||||
* @throws \DI\NotFoundException
|
||||
*/
|
||||
function handleCheckDomains()
|
||||
{
|
||||
$this->domainController->checkDomains();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue