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

Commit 9608ca2

Browse files
committed
Introduction of updateIANA()
1 parent 5cf6072 commit 9608ca2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tool

+37
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,42 @@ secondsBeforeTimeout=30
6767
# We log the date
6868
date > ${logOutput}
6969

70+
71+
################################# Update IANA ##################################
72+
# Update iana-domains-db
73+
#
74+
# @CalledBy installation
75+
################################################################################
76+
updateIANA()
77+
{
78+
# We set the url where we get the needed informations
79+
local ianaURL="https://www.iana.org/domains/root/db"
80+
81+
# Temporary file
82+
local curlIANA=/var/tmp/${funilrys}-iana
83+
84+
# We delete old temporary files
85+
rm funilrys* &> /dev/null
86+
87+
# We get a copy of the page
88+
curl -s ${ianaURL} -o ${curlIANA}
89+
90+
while read -r line
91+
do
92+
# We get the valid domains extensions
93+
regex="(\/domains\/root\/db\/)(.*)(\.html)"
94+
95+
if [[ "${line}" =~ ${regex} ]]
96+
then
97+
# We put it into a temporary file
98+
echo "${BASH_REMATCH[2]}" >> ${funilrys}_iana
99+
fi
100+
done < "${curlIANA}"
101+
102+
# We move the generated file
103+
mv ${funilrys}_iana iana-domains-db
104+
}
105+
70106
################################ checkVersion ##################################
71107
# This part is where we check the version
72108
#
@@ -490,6 +526,7 @@ scriptsWorkDir()
490526
printf '\n'
491527
elif [[ "${executionType}" == 'production' ]]
492528
then
529+
updateIANA
493530
echo "${bold}${cyan}The production logic was successfully completed!${normal}"
494531
echo "You can now distribute this repository."
495532
printf '\n'

0 commit comments

Comments
 (0)