diff --git a/app/Console/Commands/Debug/AddressCheck.php b/app/Console/Commands/Debug/AddressCheck.php new file mode 100644 index 0000000..3ea2269 --- /dev/null +++ b/app/Console/Commands/Debug/AddressCheck.php @@ -0,0 +1,32 @@ +argument('ftn')); + + if (! $o) { + $this->error(sprintf('Address: %s doesnt exist?',$this->argument('ftn'))); + return Command::FAILURE; + } + + $this->info(sprintf('Address: %s',$o->ftn)); + $this->info(sprintf('Uplink: %s',$o->parent()?->ftn)); + $this->info(sprintf('Our Address: %s',our_address($o)?->ftn)); + $this->info(sprintf('Domain Addresses: %s',our_address($o->zone->domain)->pluck('ftn4d')->join(','))); + + return Command::SUCCESS; + } +} \ No newline at end of file diff --git a/app/Console/Commands/ZoneCheck.php b/app/Console/Commands/Debug/ZoneCheck.php similarity index 83% rename from app/Console/Commands/ZoneCheck.php rename to app/Console/Commands/Debug/ZoneCheck.php index bf2e188..43687b1 100644 --- a/app/Console/Commands/ZoneCheck.php +++ b/app/Console/Commands/Debug/ZoneCheck.php @@ -1,14 +1,14 @@ warn('Zone: '.$zo->zone_id); $this->info(sprintf('- Our address(es): %s',our_address($do)->pluck('ftn4d')->join(','))); - $this->table(['id','ftn','role','parent','region_id','host_id','hub_id','system','notes'],$zo->addresses()->FTNorder()->active()->with(['system'])->get()->transform(function($item) { + $this->table(['id','ftn','role','parent','our_address','region_id','host_id','hub_id','system','notes'],$zo->addresses()->FTNorder()->active()->with(['system'])->get()->transform(function($item) { return [ 'id'=>$item->id, 'ftn'=>$item->ftn4d, 'role'=>$item->role_name, - 'parent'=>$item->parent()?->ftn4d, + 'parent'=>($x=$item->parent())?->ftn4d, + 'our_address'=>$x ? our_address($item->parent())->ftn4d : '', 'region_id'=>$item->region_id, 'host_id'=>$item->host_id, 'hub_id'=>$item->hub_id,