Skip to content

Commit

Permalink
don't download if the local file is the same as the online file
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hansson <[email protected]>
  • Loading branch information
enoch85 authored Sep 13, 2024
1 parent b55fa5f commit 7596d39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7596d39

Please sign in to comment.