aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-03-20 00:23:02 +0200
committerkaotisk <kaotisk@arching-kaos.org>2025-03-20 00:23:02 +0200
commit5469f4d66493433043b780c01ace5d6f48547e84 (patch)
treec0ffe1b28a728c5e65751fc1bb15e7737f12a2db
parent31c7f04352ef2fd47c2962be9c043a8fe902f574 (diff)
downloadarching-kaos-tools-5469f4d66493433043b780c01ace5d6f48547e84.tar.gz
arching-kaos-tools-5469f4d66493433043b780c01ace5d6f48547e84.tar.bz2
arching-kaos-tools-5469f4d66493433043b780c01ace5d6f48547e84.zip
Possible fix of inability to fetch today's values from YIA
-rwxr-xr-xlib/_ak_network_yggdrasil2
-rwxr-xr-xlib/_ak_utils4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/_ak_network_yggdrasil b/lib/_ak_network_yggdrasil
index 27fc0c8..4d365ff 100755
--- a/lib/_ak_network_yggdrasil
+++ b/lib/_ak_network_yggdrasil
@@ -36,7 +36,7 @@ function _ak_network_yggdrasil_scan_full(){
filtered_online_pubkeys_ips="$TEMPDIR/fopi"
curl -s \
--connect-timeout 5 \
- "http://yia.yggdrasil-network.ca/crawler/crawler-yia.peers.$(date -u +%Y%m%d)" > $last_seen
+ "http://yia.yggdrasil-network.ca/crawler/crawler-yia.peers.$(_ak_datetime_human_date_only_yesterday)" > $last_seen
if [ $? -ne 0 ]
then
_ak_log_error "Couldn't fetch active peers from YIA"
diff --git a/lib/_ak_utils b/lib/_ak_utils
index d9204e9..98f6ca0 100755
--- a/lib/_ak_utils
+++ b/lib/_ak_utils
@@ -33,6 +33,10 @@ function _ak_datetime_human_date_only(){
date -u +%Y%m%d
}
+function _ak_datetime_human_date_only_yesterday(){
+ date --date=yesterday -u +%Y%m%d 2>/dev/null || date -v -1d -u +%Y%m%d 2>/dev/null
+}
+
function _ak_datetime_unix_to_human(){
if [ ! -z $1 ] && [ -n "$1" ] && [ "$(echo $1 | sed -e 's/[0-9]\{10\}//g')" == "" ]
then