commit f805bda2ee4e19817622d0e25964d5b65e44efa4 from: jrmu date: Thu Feb 23 01:09:51 2023 UTC Moved date subrountine into DNS.pm commit - 7aeaeb38a8bcbc329e5e408eeeb40f7531a2ea37 commit + f805bda2ee4e19817622d0e25964d5b65e44efa4 blob - ba1da2271e5ace5b0c47eeb900723f05eab2ddb0 blob + 920b01ae92fc73d0c4b9232d27557c790269a38e --- DNS.pm +++ DNS.pm @@ -6,7 +6,6 @@ use strict; use warnings; use OpenBSD::Pledge; use OpenBSD::Unveil; -use Data::Dumper; use File::Copy qw(copy); my %conf = %main::conf; @@ -158,6 +157,13 @@ sub setrdns { sub delrdns { my ($ip6, $subnet) = @_; return setrdns($ip6, $subnet); +} + +# Returns date in YYYYMMDD format +sub date { + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); + my $localtime = sprintf("%04d%02d%02d", $year+1900, $mon+1, $mday); + return $localtime; } # given $origin. create $name RR of $type and set to $value if provided; blob - ba922b7604d9d33f2dd10e4ca0de13f97ab866e7 blob + d4c0ecc478325335d938ca3342ee57780e3cb67e --- botnow +++ botnow @@ -42,13 +42,6 @@ sub appendfile { close $fh; } -# Returns date in YYYYMMDD format -sub date { - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); - my $localtime = sprintf("%04d%02d%02d", $year+1900, $mon+1, $mday); - return $localtime; -} - # Returns timestamp in "Day MM DD HH:MM:SS" format sub gettime { my @months = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );