From eb97e893a835f728f4bff344d937d0b1813f711e Mon Sep 17 00:00:00 2001 From: Steven Schubiger Date: Mon, 18 Nov 2013 19:57:09 +0100 Subject: Record and list last updated time --- client.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client.pl') 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; } -- cgit v1.2.3