diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2015-05-03 11:18:54 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2015-05-03 11:18:54 +0200 |
commit | 4c08d48e712b2475d61cbba8785549be12021e60 (patch) | |
tree | d7c212f755953b9dd14d5b1d4e5fe2c4087eab81 /web/nms.gathering.org/port-state.pl | |
parent | c3684f65dabfffd3a2df5a22685194547c7d213c (diff) | |
parent | 2c9231ff1b71e608b369df8666b3b1ec2f32bb74 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/port-state.pl')
-rwxr-xr-x | web/nms.gathering.org/port-state.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/nms.gathering.org/port-state.pl b/web/nms.gathering.org/port-state.pl index b21bd8d..9df31c0 100755 --- a/web/nms.gathering.org/port-state.pl +++ b/web/nms.gathering.org/port-state.pl @@ -69,7 +69,12 @@ while (my $ref = $q4->fetchrow_hashref()) { # push @{$json{'linknets'}}, $ref; } -my $q5 = $dbh->prepare ('select ' . $now . ' as time;'); +my $q5; +if (defined($cin)) { + $q5 = $dbh->prepare ('select (' . $now . ' - \'' . $cin . '\'::interval) as time;'); +} else { + $q5 = $dbh->prepare ('select ' . $now . ' as time;'); +} $q5->execute(); $json{'time'} = $q5->fetchrow_hashref()->{'time'}; |