Commit 38cbe9cb authored by Eric's avatar Eric
Browse files

ajout de quelques verifications d'existence reelle du domaine avant de lancer...

ajout de quelques verifications d'existence reelle du domaine avant de lancer la demande de certificats
parent 1b24c047
......@@ -12,6 +12,8 @@ function ldebug()
fi
}
MYIPS=`ip -f inet -o addr | awk '!/^[0-9]*: ?lo|link\/ether/ {gsub("/", " "); print $4}'`
rm -f /etc/dehydrated/domains.txt
if [ -f /etc/apache2/reference_soo.new ]; then
FIC=/etc/apache2/reference_soo.new
......@@ -24,10 +26,13 @@ for domaine in `cat ${FIC}`
do
ldebug "on bosse sur ${domaine} .."
#test si le domaine existe ...
TESTDOMAINE=`getent hosts ${domaine} | head -n1`
if [ -n "${TESTDOMAINE}" ]; then
echo ${domaine} >> ${FIC}.ok
fi
TESTDOMAINE=`getent hosts ${domaine} | head -n1 | awk '{print $1}'`
for myip in ${MYIPS}
do
if [ "${TESTDOMAINE}" = ${myip} ]; then
echo ${domaine} >> ${FIC}.ok
fi
done
done
cat /etc/dehydrated/domains.txt_origine ${FIC}.ok > /etc/dehydrated/domains.txt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment