-
-
Save c80609a/f7937561e4d00d096b88cb3624138c1a 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