From 7596d395c08ca10776dd2f32e47fd5a71eb59a9e Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 13 Sep 2024 17:56:48 +0200 Subject: [PATCH] don't download if the local file is the same as the online file Signed-off-by: Daniel Hansson --- lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib.sh b/lib.sh index 4a27340896..7902b1a57c 100644 --- a/lib.sh +++ b/lib.sh @@ -414,11 +414,11 @@ then then # DIFF local file with month from curl # This is to know if the online file is the same month as the local file - LOCAL_FILE_TIMESTAMP=$(date -r /usr/share/GeoIP/GeoIP.dat "+%B %Y") + LOCAL_FILE_TIMESTAMP=$(date -r /usr/share/GeoIP/GeoIPv4.dat "+%B %Y") LOCAL_FILE_TIMESTAMP="${LOCAL_FILE_TIMESTAMP^}" ONLINE_FILE_TIMESTAMP="$CURR_MONTH $CURR_YEAR" - if [ "$ONLINE_FILE_TIMESTAMP" = "$LOCAL_FILE_TIMESTAMP" ] # Should this check if the file is NOT the same? - then # If true then update! + if [ "$ONLINE_FILE_TIMESTAMP" != "$LOCAL_FILE_TIMESTAMP" ] + then # IPv4 download_geoip_dat "4" "v4" # IPv6