From 12a72a3dd636bc0a9d3f33d952e91f502c1eb7f6 Mon Sep 17 00:00:00 2001 From: Sebastien Laithier Date: Fri, 9 Aug 2019 14:09:17 +0200 Subject: [PATCH] Renaming file, adapting scripts --- geoip-percontinent.sh | 6 +++--- geoip-percountry.sh | 6 +++--- source/{temp.txt => range-country_code.txt} | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename source/{temp.txt => range-country_code.txt} (100%) diff --git a/geoip-percontinent.sh b/geoip-percontinent.sh index eae68d9..5359c60 100755 --- a/geoip-percontinent.sh +++ b/geoip-percontinent.sh @@ -1,7 +1,7 @@ #!/bin/bash -FILE_RANGE="./temp.txt" -FILE_COUNTRY_CODE="./GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv" +FILE_RANGE="./source/range-country_code.txt" +FILE_COUNTRY_CODE="./source/GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv" CODE=0 while read p; do @@ -28,4 +28,4 @@ while read p; do printf "%s %s\n" "$RANGE" "$CONTINENT" >> NA.txt ;; esac -done < temp.txt +done < $FILE_RANGE diff --git a/geoip-percountry.sh b/geoip-percountry.sh index a9f84da..b2b1b41 100755 --- a/geoip-percountry.sh +++ b/geoip-percountry.sh @@ -1,7 +1,7 @@ #!/bin/bash -FILE_RANGE="./temp.txt" -FILE_COUNTRY_CODE="./GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv" +FILE_RANGE="./source/range-country_code.txt" +FILE_COUNTRY_CODE="./source/GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv" CODE=0 while read p; do @@ -9,4 +9,4 @@ while read p; do RANGE=$(awk -F ',' '{print $1}' <<< $p) COUNTRY=$(awk -v country_code="$CODE" -F ',' '$0 ~ country_code {print $5}' $FILE_COUNTRY_CODE) printf "%s\n" "$RANGE" >> ./country/"$COUNTRY".txt -done < temp.txt +done < $FILE_RANGE diff --git a/source/temp.txt b/source/range-country_code.txt similarity index 100% rename from source/temp.txt rename to source/range-country_code.txt