-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcertbot-cleanup.sh
executable file
·31 lines (25 loc) · 1.05 KB
/
certbot-cleanup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -ue -o pipefail
export LC_ALL=C
###
# dns-challenge/certbot-authenticator
#
# https://github.com/furplag/dns-challenge
# Copyright 2021 furplag
# Licensed under Apache 2.0 (https://github.com/furplag/dns-challenge/blob/master/LICENSE)
### variables
# constants
if ! declare -p name >/dev/null 2>&1; then declare -r name=`basename ${0:-}`; fi
if ! declare -p basedir >/dev/null 2>&1; then declare -r basedir=$(cd $(dirname $0); pwd); fi
if ! declare -p dns_type >/dev/null 2>&1; then declare -r dns_type=$(echo "${name:-}" | sed -e 's/\..*$//' -e 's/^.*\-//'); fi
if [[ -z "${dns_type}" ]]; then exit 1; fi
if ! declare -p configuration_file >/dev/null 2>&1; then declare -r configuration_file=${basedir}/.credencials/${dns_type}; fi
if ! declare -p CERTBOT_DOMAIN >/dev/null 2>&1; then declare -r CERTBOT_DOMAIN=; fi
cat <<_EOT_|bash -s -- teardown "${CERTBOT_DOMAIN}"
declare -r name=${name}
declare -r basedir=${basedir}
declare -r dns_type=${dns_type}
declare -r configuration_file=${configuration_file}
source ${basedir}/dns-challenge.sh
_EOT_
exit $?