Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Introduction of updateIANA()
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Jul 16, 2017
1 parent 5cf6072 commit 9608ca2
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tool
Expand Up @@ -67,6 +67,42 @@ secondsBeforeTimeout=30
# We log the date
date > ${logOutput}


################################# Update IANA ##################################
# Update iana-domains-db
#
# @CalledBy installation
################################################################################
updateIANA()
{
# We set the url where we get the needed informations
local ianaURL="https://www.iana.org/domains/root/db"

# Temporary file
local curlIANA=/var/tmp/${funilrys}-iana

# We delete old temporary files
rm funilrys* &> /dev/null

# We get a copy of the page
curl -s ${ianaURL} -o ${curlIANA}

while read -r line
do
# We get the valid domains extensions
regex="(\/domains\/root\/db\/)(.*)(\.html)"

if [[ "${line}" =~ ${regex} ]]
then
# We put it into a temporary file
echo "${BASH_REMATCH[2]}" >> ${funilrys}_iana
fi
done < "${curlIANA}"

# We move the generated file
mv ${funilrys}_iana iana-domains-db
}

################################ checkVersion ##################################
# This part is where we check the version
#
Expand Down Expand Up @@ -490,6 +526,7 @@ scriptsWorkDir()
printf '\n'
elif [[ "${executionType}" == 'production' ]]
then
updateIANA
echo "${bold}${cyan}The production logic was successfully completed!${normal}"
echo "You can now distribute this repository."
printf '\n'
Expand Down

0 comments on commit 9608ca2

Please sign in to comment.