Start GenDuid replacement

This commit is contained in:
James Gilliland 2022-03-05 18:04:55 -06:00
parent 3534ed974c
commit 27f49445fb
2 changed files with 39 additions and 0 deletions

37
src/Commands/GenDuid.php Normal file
View file

@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace Pfatt\Commands;
use Pfatt\Service\Logger;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class GenDuid extends Command
{
protected static $defaultName = 'gen-duid';
protected static $defaultDescription = 'Generate DUID for IPV6 configuration.';
protected Logger $logger;
public function __construct(
Logger $logger,
) {
parent::__construct('gen-duid');
$this->logger = $logger;
}
/**
* {@inheritDoc}
*/
protected function execute(
InputInterface $input,
OutputInterface $output
): int {
$this->logger->setOutput($output);
$this->logger->info('Starting 5268AC ping monitor ...');
return Command::SUCCESS;
}
}

View file

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Pfatt;
use Pfatt\Commands\GenDuid;
use Pfatt\Commands\Monitor;
use Pfatt\Commands\Startup;
use Pfatt\Service\Config;
@ -25,6 +26,7 @@ final class PfattKernel
private $commands = [
'monitor' => Monitor::class,
'startup' => Startup::class,
'gen-duid' => GenDuid::class,
];
public function create(): Application