Last active
March 12, 2023 10:32
-
-
Save Andsbf/56a7ff4572e8b03a8cdf0c955a6c43bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Download IP Geolocation Database from Maxmind.com | |
[Service] | |
Type=oneshot | |
WorkingDirectory=/tmp | |
ExecStart=/bin/sh -c "\ | |
mkdir -p /home/core/ip_database \ | |
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz ; \ | |
gunzip GeoLite2-City.mmdb.gz ; \ | |
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5 ; \ | |
md5result=$(md5sum -c <<< \"`cat GeoLite2-City.md5` GeoLite2-City.mmdb\" | awk '{print $2}') ; \ | |
if [ \"$md5result\" == 'OK' ]; then cp GeoLite2-City.mmdb /home/core/ip_database/GeoLite2-City.mmdb; else exit 1 ; fi" | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment