-eq 0 and $SCRIPTS
This commit is contained in:
Родитель
09cae07b1b
Коммит
4648a893f9
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче