Last active
July 22, 2021 12:16
-
-
Save deanet/aa937e4c6aa3187dff887e0288443d44 to your computer and use it in GitHub Desktop.
Revisions
-
deanet revised this gist
Jul 22, 2021 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,11 @@ #!/bin/bash ## upgrade automatically /root/.acme.sh/ domain config on Le_API from https://acme-v01.api.letsencrypt.org/directory to https://acme-v02.api.letsencrypt.org/directory ## blog.dgprasetya.com ##upgrade acme.sh first "/root/.acme.sh"/acme.sh --upgrade cd /root/.acme.sh tar -cvf /root/backup-acme.sh-`date +%F_%H%M`.tar /root/.acme.sh -
deanet created this gist
Jul 22, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/bin/bash ## upgrade automatically /root/.acme.sh/ domain config on Le_API from https://acme-v01.api.letsencrypt.org/directory to https://acme-v02.api.letsencrypt.org/directory cd /root/.acme.sh tar -cvf /root/backup-acme.sh-`date +%F_%H%M`.tar /root/.acme.sh ## https://community.centminmod.com/threads/acmev1-deprecated-and-shutdown-june-1st-2021.21586/#post-89505 find /root/.acme.sh/ -type f -name "*.csr" | while read f; do configname=$(echo "$f" | sed -e 's|\.csr|\.conf|g'); echo "$configname"; grep '\.api' "$configname"; echo; if [ "$(grep "Le_API='https://acme-v01.api" $configname)" ]; then echo "Update Le_API in $configname"; sed -i "s|Le_API='https:\/\/acme-v01.api|Le_API='https:\/\/acme-v02.api|" "$configname"; grep 'Le_API=' "$configname"; echo; fi; done ##run jobs "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" service nginx reload