aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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