mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-24 18:03:06 +02:00
libloc: Only update database once a week
Ensure to download and update the database only once a week, even the script will be called by cron each hour. Fixes #12462. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
18f0510429
commit
99659ce50b
@@ -21,6 +21,8 @@
|
||||
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
|
||||
|
||||
UPDATE_INTERVAL="weekly"
|
||||
|
||||
# Proxy settings.
|
||||
# Check if a proxy should be used.
|
||||
if [[ $UPSTREAM_PROXY ]]; then
|
||||
@@ -39,7 +41,7 @@ if [[ $UPSTREAM_PROXY ]]; then
|
||||
fi
|
||||
|
||||
# Get the latest location database from server.
|
||||
if /usr/bin/location update; then
|
||||
if /usr/bin/location update --cron=$UPDATE_INTERVAL; then
|
||||
# Call location and export all countries in xt_geoip compatible format.
|
||||
if /usr/bin/location export --directory=/usr/share/xt_geoip --family=ipv4 --format=xt_geoip; then
|
||||
|
||||
|
||||
Reference in New Issue
Block a user