Commit afdcc7cf authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

support altnames.

parent 4fae1355
...@@ -3,38 +3,46 @@ set -e ...@@ -3,38 +3,46 @@ set -e
set -u set -u
set -o pipefail set -o pipefail
domain="${2}" operation="${1}"; shift
token_id="${3}"
token="${4}"
case "${1}" in case "${operation}" in
"deploy_challenge") "deploy_challenge")
statuscode="$(curl -s -k -n -L -o /dev/null -w "%{http_code}" "https://${domain}/.well-known/acme-challenge/manage_addFile?id=${token_id}")" while [ "$#" != 0 ]; do
if [[ ! "${statuscode:0:1}" = "2" ]]; then domain="${1}"; shift
statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_addFile?id=${token_id}")" token_id="${1}"; shift
token="${1}"; shift
statuscode="$(curl -s -k -n -L -o /dev/null -w "%{http_code}" "https://${domain}/.well-known/acme-challenge/manage_addFile?id=${token_id}")"
if [[ ! "${statuscode:0:1}" = "2" ]]; then if [[ ! "${statuscode:0:1}" = "2" ]]; then
echo 'Failed' statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_addFile?id=${token_id}")"
exit 1 if [[ ! "${statuscode:0:1}" = "2" ]]; then
echo 'Failed'
exit 1
fi
fi fi
fi statuscode="$(curl -s -k -n -L -o /dev/null -w "%{http_code}" "https://${domain}/.well-known/acme-challenge/${token_id}/manage_edit?title=&content_type=text/plain&filedata=${token}")"
statuscode="$(curl -s -k -n -L -o /dev/null -w "%{http_code}" "https://${domain}/.well-known/acme-challenge/${token_id}/manage_edit?title=&content_type=text/plain&filedata=${token}")"
if [[ ! "${statuscode:0:1}" = "2" ]]; then
statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/${token_id}/manage_edit?title=&content_type=text/plain&filedata=${token}")"
if [[ ! "${statuscode:0:1}" = "2" ]]; then if [[ ! "${statuscode:0:1}" = "2" ]]; then
echo 'Failed' statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/${token_id}/manage_edit?title=&content_type=text/plain&filedata=${token}")"
exit 1 if [[ ! "${statuscode:0:1}" = "2" ]]; then
echo 'Failed'
exit 1
fi
fi fi
fi done
;; ;;
"clean_challenge") "clean_challenge")
statuscode="$(curl -s -k -n -L -o /dev/null -w "%{http_code}" "https://${domain}/.well-known/acme-challenge/manage_delObjects?ids:list=${token_id}")" while [ "$#" != 0 ]; do
if [[ ! "${statuscode:0:1}" = "2" ]]; then domain="${1}"; shift
statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_delObjects?ids:list=${token_id}")" token_id="${1}"; shift
token="${1}"; shift
statuscode="$(curl -s -k -n -L -o /dev/null -w "%{http_code}" "https://${domain}/.well-known/acme-challenge/manage_delObjects?ids:list=${token_id}")"
if [[ ! "${statuscode:0:1}" = "2" ]]; then if [[ ! "${statuscode:0:1}" = "2" ]]; then
echo 'Failed' statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_delObjects?ids:list=${token_id}")"
exit 1 if [[ ! "${statuscode:0:1}" = "2" ]]; then
echo 'Failed'
exit 1
fi
fi fi
fi done
;; ;;
esac esac
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment