X-Git-Url: http://git.refcnt.org/?p=distdns.git;a=blobdiff_plain;f=client.pl;h=729663f51a3c9a0b37148fddb617b9aa26960326;hp=aab5ea47f89691473f728b1ffd9b1c197e4ddd68;hb=eb97e893a835f728f4bff344d937d0b1813f711e;hpb=3f79b3088e5eaa6185822f26c21a3b5e8548e60e diff --git a/client.pl b/client.pl index aab5ea4..729663f 100755 --- a/client.pl +++ b/client.pl @@ -29,6 +29,7 @@ use FindBin qw($Bin); use Getopt::Long qw(:config no_auto_abbrev no_ignore_case); use JSON qw(decode_json); use LWP::UserAgent; +use POSIX qw(strftime); use Sys::Hostname qw(hostname); use Tie::File; @@ -130,13 +131,14 @@ if ($response->is_success) { } elsif ($opts{l}) { format STDOUT_TOP = -IP Name PC Netz -============================================================================= +IP Name PC Netz Aktualisiert +==================================================================================================== . foreach my $entry (sort { $a->{netz} cmp $b->{netz} } @{$data->{entries}}) { + my $updated = strftime '%Y-%m-%d %H:%M:%S', localtime $entry->{time}; format STDOUT = -@<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< -@$entry{qw(ip name pc netz)} +@<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<< +@$entry{qw(ip name pc netz)}, $updated . write; }