Commit afdcc7cf authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

support altnames.

parent 4fae1355
...@@ -3,12 +3,14 @@ set -e ...@@ -3,12 +3,14 @@ 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")
while [ "$#" != 0 ]; do
domain="${1}"; shift
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}")" 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
statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_addFile?id=${token_id}")" statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_addFile?id=${token_id}")"
...@@ -25,8 +27,13 @@ case "${1}" in ...@@ -25,8 +27,13 @@ case "${1}" in
exit 1 exit 1
fi fi
fi fi
done
;; ;;
"clean_challenge") "clean_challenge")
while [ "$#" != 0 ]; do
domain="${1}"; shift
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}")" 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
statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_delObjects?ids:list=${token_id}")" statuscode="$(curl -s -n -L -o /dev/null -w "%{http_code}" "http://${domain}/.well-known/acme-challenge/manage_delObjects?ids:list=${token_id}")"
...@@ -35,6 +42,7 @@ case "${1}" in ...@@ -35,6 +42,7 @@ case "${1}" in
exit 1 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