diff options
author | Steven Schubiger <stsc@refcnt.org> | 2013-11-18 19:57:09 +0100 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2013-11-18 19:57:09 +0100 |
commit | eb97e893a835f728f4bff344d937d0b1813f711e (patch) | |
tree | 076923b808b5291542180fce052efc0e24b2a4ca /client.pl | |
parent | 3f79b3088e5eaa6185822f26c21a3b5e8548e60e (diff) | |
download | distdns-eb97e893a835f728f4bff344d937d0b1813f711e.tar.gz distdns-eb97e893a835f728f4bff344d937d0b1813f711e.tar.bz2 |
Record and list last updated time
Diffstat (limited to 'client.pl')
-rwxr-xr-x | client.pl | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; } |