Commit Diff
Diff:
7aeaeb38a8bcbc329e5e408eeeb40f7531a2ea37
f805bda2ee4e19817622d0e25964d5b65e44efa4
Commit:
f805bda2ee4e19817622d0e25964d5b65e44efa4
Tree:
485f4889cbebdcf6fcf0ae42497e37f3d31f5f54
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Thu Feb 23 01:09:51 2023 UTC
Message:
Moved date subrountine into DNS.pm
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;
@@ -160,6 +159,13 @@ sub delrdns {
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;
# if $value is missing, delete $domain
# returns true upon success, false upon failure
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 );
IRCNow