summaryrefslogtreecommitdiffstats
path: root/debian/create-orig.sh
blob: 1dca095844bf32079ae97d4fb3655f1e560b7d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

OLDDIR=$(pwd)
TMPDIR=$(mktemp -d)
DATE=$(date +'%Y%m%d')

cd ${TMPDIR}

wget https://mailfud.org/geoip-legacy/GeoIP.dat.gz
wget https://mailfud.org/geoip-legacy/GeoIPv6.dat.gz
gunzip GeoIP.dat.gz GeoIPv6.dat.gz

mkdir ${TMPDIR}/geoip-database-${DATE}

mv GeoIP.dat GeoIPv6.dat ${TMPDIR}/geoip-database-${DATE}/

tar -cJf geoip-database_${DATE}.orig.tar.xz geoip-database-${DATE}
mv geoip-database_${DATE}.orig.tar.xz ${OLDDIR}/../geoip-database_${DATE}.orig.tar.xz

cd ${OLDDIR}
rm -rf ${TMPDIR}

echo "Saved tarball: ${OLDDIR}/../geoip-database_${DATE}.orig.tar.xz"

exit 0