mirror of
https://github.com/luxfi/pics.git
synced 2026-10-30 15:22:15 +00:00
/etc/nginx/ "includes" -> "snippets" remove nginx reload, since there are multiple tools that require that. better to have a separate cron task that does it after just once and add execute bit... lol
17 lines
495 B
Bash
Executable File
17 lines
495 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Script to update geoip database for nginx/jschan. Can be added as a cronjob
|
|
#
|
|
|
|
#go to geoip folder
|
|
cd /usr/share/GeoIP
|
|
#move the existing db to a .bak just in case
|
|
mv GeoIP.dat GeoIP.dat.bak
|
|
#try and download the DBIP database
|
|
wget --retry-connrefused https://dl.miyuru.lk/geoip/dbip/country/dbip.dat.gz
|
|
#extract and move it
|
|
gunzip dbip.dat.gz
|
|
mv dbip.dat GeoIP.dat
|
|
#make sure www-data (debian nginx user:group) has permissions
|
|
chown www-data:www-data /usr/share/GeoIP/GeoIP.dat
|