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