]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
geoip: pipe wget right into gzip
authorJan Engelhardt <jengelh@inai.de>
Tue, 21 Apr 2020 10:01:52 +0000 (12:01 +0200)
committerJan Engelhardt <jengelh@inai.de>
Tue, 21 Apr 2020 10:01:52 +0000 (12:01 +0200)
Skip over creating temporary files.

geoip/xt_geoip_dl

index 91aa95b650a968fb8cd989ac5b08ec890a45f008..26a7892a8ee5ba33c956c581bd51aa70364ce8e2 100755 (executable)
@@ -1,11 +1,5 @@
 #!/bin/sh
 
 timestamp=$(date "+%Y-%m")
-
-wget -q "https://download.db-ip.com/free/dbip-country-lite-${timestamp}.csv.gz"
-
-zcat dbip-country-lite-${timestamp}.csv.gz > dbip-country-lite.csv
-
-rm -f dbip-country-lite-${timestamp}.csv.gz
-
-exit 0
+wget -q "https://download.db-ip.com/free/dbip-country-lite-$timestamp.csv.gz" -O- | \
+       gzip -cd >dbip-country-lite.csv