Merge pull request #686 from darko-poljak/letsencrypt_cert_explorers_fix

Check if certbot exists before using it. Fixes #685.
This commit is contained in:
Darko Poljak 2018-09-01 23:29:37 +02:00 committed by GitHub
commit b67051fac5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 7 deletions

View file

@ -1,4 +1,8 @@
#!/bin/sh -e #!/bin/sh -e
certbot_path=$("${__type_explorer}/certbot-path")
if [ -n "${certbot_path}" ]
then
certbot certificates --cert-name "${__object_id:?}" | grep ' Domains: ' | \ certbot certificates --cert-name "${__object_id:?}" | grep ' Domains: ' | \
cut -d ' ' -f 6- | tr ' ' '\n' cut -d ' ' -f 6- | tr ' ' '\n'
fi

View file

@ -1,7 +1,13 @@
#!/bin/sh -e #!/bin/sh -e
certbot_path=$("${__type_explorer}/certbot-path")
if [ -n "${certbot_path}" ]
then
if certbot certificates | grep -q " Certificate Name: ${__object_id:?}$"; then if certbot certificates | grep -q " Certificate Name: ${__object_id:?}$"; then
echo yes echo yes
else else
echo no echo no
fi fi
else
echo no
fi

View file

@ -1,8 +1,14 @@
#!/bin/sh -e #!/bin/sh -e
certbot_path=$("${__type_explorer}/certbot-path")
if [ -n "${certbot_path}" ]
then
if certbot certificates --cert-name "${__object_id:?}" | \ if certbot certificates --cert-name "${__object_id:?}" | \
grep -q 'INVALID: TEST_CERT'; then grep -q 'INVALID: TEST_CERT'; then
echo yes echo yes
else else
echo no echo no
fi fi
else
echo no
fi