forked from evolix/evocheck
IS_EVOACME_LIVELINKS: Add a condition when there is no certificates
This commit is contained in:
parent
08b5ae0819
commit
cd38bbaab4
28
evocheck.sh
28
evocheck.sh
|
@ -782,18 +782,22 @@ if [ -e /etc/debian_version ]; then
|
||||||
|
|
||||||
if [ "$IS_EVOACME_LIVELINKS" = 1 ]; then
|
if [ "$IS_EVOACME_LIVELINKS" = 1 ]; then
|
||||||
if [ -x "$(which evoacme)" ]; then
|
if [ -x "$(which evoacme)" ]; then
|
||||||
for live in /etc/letsencrypt/*/live; do
|
# Sometimes evoacme is installed but no certificates has been generated
|
||||||
actualLink=$(ls -lhad $live | tr -s ' ' | cut -d' ' -f 11)
|
numberOfLinks=$(find /etc/letsencrypt/ -type l | wc -l)
|
||||||
actualCertDate=$(cut -d'/' -f5 <<< $actualLink)
|
if [ $numberOfLinks -gt 0 ]; then
|
||||||
liveDir=$(ls -lhad $live | tr -s ' ' | cut -d' ' -f 9)
|
for live in /etc/letsencrypt/*/live; do
|
||||||
certDir=${liveDir%%/live}
|
actualLink=$(ls -lhad $live | tr -s ' ' | cut -d' ' -f 11)
|
||||||
lastCertDir=$(stat -c %n ${certDir}/[0-9]* | tail -1)
|
actualCertDate=$(cut -d'/' -f5 <<< $actualLink)
|
||||||
lastCertDate=$(cut -d'/' -f5 <<< $lastCertDir)
|
liveDir=$(ls -lhad $live | tr -s ' ' | cut -d' ' -f 9)
|
||||||
if [[ "$actualCertDate" != "$lastCertDate" ]]; then
|
certDir=${liveDir%%/live}
|
||||||
echo 'IS_EVOACME_LIVELINKS FAILED!'
|
lastCertDir=$(stat -c %n ${certDir}/[0-9]* | tail -1)
|
||||||
break
|
lastCertDate=$(cut -d'/' -f5 <<< $lastCertDir)
|
||||||
fi
|
if [[ "$actualCertDate" != "$lastCertDate" ]]; then
|
||||||
done
|
echo 'IS_EVOACME_LIVELINKS FAILED!'
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue