mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
geoip: use postinstall to download mmdb
This commit is contained in:
1 parent
6bbcd983a3
commit
f2f5e808c4
2 files changed
+8
-6
No files matched your search
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/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"
|
if [ ! -f "./GeoLite2-City.mmdb" ]; then
|
||||||
tar zxvf ./GeoLite2-City.tar.gz -C .
|
wget -O ./GeoLite2-City.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz"
|
||||||
mv ./GeoLite2-City_*/GeoLite2-City.mmdb ./GeoLite2-City.mmdb
|
tar zxvf ./GeoLite2-City.tar.gz -C .
|
||||||
rm -r ./GeoLite2-City_* ./GeoLite2-City.tar.gz
|
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"
|
"maxmind": "^4.3.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "./download.sh"
|
"postinstall": "./download.sh"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"hydrooj": "^2.15.0"
|
"hydrooj": "^2.15.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user