Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
GeoIP
geoip-fetch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File geoip-fetch of Package GeoIP
#!/bin/bash set -e baseurl="http://geolite.maxmind.com/download/geoip/database" geoipdir='/var/lib/GeoIP' tempdir=`mktemp -d` cd "$tempdir" trap "/bin/rm -rf $tempdir" EXIT sources=(GeoLiteCountry/GeoIP.dat.gz GeoIPv6.dat.gz asnum/GeoIPASNum.dat.gz -- GeoLiteCity.dat.gz) targets=(GeoIP.dat GeoIPv6.dat GeoIPASNum.dat -- GeoIPCity.dat) verbose= if [ -t 0 ]; then verbose="-#" fi skiplarge=1 if [ "$1" = "-a" ]; then skiplarge= shift fi i=0 while [ $i -lt ${#sources[@]} ]; do if [ ${sources[$i]} = '--' ]; then i=$((i+1)) [ -z "$skiplarge" ] || break continue fi [ -z "$verbose" ] || echo "${targets[$i]} ..." if curl ${verbose:--s} -f -o "$tempdir/${targets[$i]}.gz" "$baseurl/${sources[$i]}"; then if gzip -d ${targets[$i]}.gz; then mv ${targets[$i]} "$geoipdir/${targets[$i]}" fi fi i=$((i+1)) done
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor