Merge branch 'master' into 35-is_evoacme_certbotcron

This commit is contained in:
Benoît S. 2018-06-13 18:09:27 +02:00
commit 6bce242efb

View file

@ -103,6 +103,7 @@ IS_DUPLICATE_FS_LABEL=1
IS_EVOMAINTENANCE_FW=1
IS_EVOLIX_USER=1
IS_EVOACME_CRON=1
IS_EVOACME_LIVELINKS=1
#Proper to OpenBSD
IS_SOFTDEP=1
@ -776,6 +777,22 @@ if [ -e /etc/debian_version ]; then
test -f /etc/cron.daily/evoacme || echo 'IS_EVOACME_CRON FAILED!'
fi
fi
if [ "$IS_EVOACME_LIVELINKS" = 1 ]; then
if [ -x "$(which evoacme)" ]; then
for live in /etc/letsencrypt/*/live; do
actualLink=$(ls -lhad $live | tr -s ' ' | cut -d' ' -f 11)
actualCertDate=$(cut -d'/' -f5 <<< $actualLink)
liveDir=$(ls -lhad $live | tr -s ' ' | cut -d' ' -f 9)
certDir=${liveDir%%/live}
lastCertDir=$(stat -c %n ${certDir}/[0-9]* | tail -1)
lastCertDate=$(cut -d'/' -f5 <<< $lastCertDir)
if [[ "$actualCertDate" != "$lastCertDate" ]]; then
echo 'IS_EVOACME_LIVELINKS FAILED!'
break
fi
done
fi
fi
fi