This commit is contained in:
Daniel Hansson 2016-10-20 02:10:58 +02:00 коммит произвёл GitHub
Родитель 09cae07b1b
Коммит 4648a893f9
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -26,17 +26,16 @@ then
read -p "Press any key to continue... " -n1 -s
echo -e "\e[0m"
crontab -u root -l | { cat; echo "@monthly $SCRIPTS/letsencryptrenew.sh"; } | crontab -u root -
cat << CRONTAB > "/var/scripts/letsencryptrenew.sh"
cat << CRONTAB > "$SCRIPTS/letsencryptrenew.sh"
#!/bin/sh
set -x
systemctl stop apache2.service
service nginx stop
if ! /opt/letsencrypt/letsencrypt-auto renew > /var/log/letsencrypt/renew.log 2>&1 ; then
echo Automated renewal failed:
cat /var/log/letsencrypt/renew.log
exit 1
fi
systemctl start apache2.service
if [[ $? == 0 ]]
service nginx start
if [[ $? -eq 0 ]]
then
echo "Let's Encrypt SUCCESS!"--$(date +%Y-%m-%d_%H:%M) >> /var/log/letsencrypt/cronjob.log
else