geoip: use postinstall to download mmdb

pull/94/head
undefined 4 years ago
parent 6bbcd983a3
commit f2f5e808c4

@ -1,6 +1,8 @@
#!/bin/bash
wget -O ./GeoLite2-City.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz"
tar zxvf ./GeoLite2-City.tar.gz -C .
mv ./GeoLite2-City_*/GeoLite2-City.mmdb ./GeoLite2-City.mmdb
rm -r ./GeoLite2-City_* ./GeoLite2-City.tar.gz
if [ ! -f "./GeoLite2-City.mmdb" ]; then
wget -O ./GeoLite2-City.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz"
tar zxvf ./GeoLite2-City.tar.gz -C .
mv ./GeoLite2-City_*/GeoLite2-City.mmdb ./GeoLite2-City.mmdb
rm -r ./GeoLite2-City_* ./GeoLite2-City.tar.gz
fi

@ -9,9 +9,9 @@
"maxmind": "^4.3.1"
},
"scripts": {
"prepare": "./download.sh"
"postinstall": "./download.sh"
},
"peerDependencies": {
"hydrooj": "^2.15.0"
}
}
}

Loading…
Cancel
Save