Commit 22a215c7 authored by remy's avatar remy
Browse files

adding a profile file to be sourced

parent 240ea8f6
......@@ -5,6 +5,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${DIR}
. ./profile.conf
websites=`cat host_https_list.txt`
TOTAL_WEBSITES=`echo ${websites}|awk '{print NF}'`
......@@ -31,7 +32,7 @@ ssl_answers=`for host in ${websites}; do echo -n "$host:" && bash ${DIR}/ssl-cer
count=`echo "${ssl_answers}" | grep -c "Ok"`
# 9 machines should answer Ok...
if [ $count -ne $TOTAL_WEBSITES ]; then
echo "${ssl_answers}" |mail -s "MBB letsencrypt cert checks" mbb-logs@mbb.umontpellier.fr
echo "${ssl_answers}" |mail -s "${MAIL_SUBJECT}" $MAIL
fi
cd ${CURDIR}
......@@ -36,13 +36,6 @@
CURDIR=`pwd`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKDIR=${DIR}/workdir
CHECK_CERT=false
if ${CHECK_CERT}; then
CURL_OPTS="-Is"
else
CURL_OPTS="-Iks"
fi
# path to commands; could be useful for crons
CURL=`command -v curl`
......@@ -143,6 +136,16 @@ function remove_dyn_elems {
done < $1
}
cd ${DIR}
. ./profile.conf
if ${CHECK_CERT}; then
CURL_OPTS="-Is"
else
CURL_OPTS="-Iks"
fi
if [[ "$1" == "compare" ]]; then
cd ${WORKDIR}
for file in `ls *.html`; do
......
MAIL="foobar@tld.domain.com"
MAIL_SUBJECT="certificate error"
# following must be set to false if you have some autosigns certificates website
# otherwise, you can set it to true
CHECK_CERT=false
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