aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/port-state.pl
diff options
context:
space:
mode:
Diffstat (limited to 'web/nms.gathering.org/port-state.pl')
-rwxr-xr-xweb/nms.gathering.org/port-state.pl7
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'};