Add interactive dns
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
# Certificates will automatically be issued and deployed for DOMAIN and www.DOMAIN using the webroot method
|
# Certificates will automatically be issued and deployed for DOMAIN and www.DOMAIN using the webroot method
|
||||||
#
|
#
|
||||||
# NOTE: The webroot method does NOT support wildcard domains, Let's Encrypt requires wildcard domains to
|
# NOTE: The webroot method does NOT support wildcard domains, Let's Encrypt requires wildcard domains to
|
||||||
# use DNS challenges, which the CPANEL uapi does not support (use dns_cpaneldns plugin instead)
|
# use DNS challenges, which the cPanel uapi does not support (use dns method instead)
|
||||||
|
|
||||||
unset SITES_DIR USEREMAIL DOMAIN_FILES DOMAIN_GROUPS DEPLOY_CMD_PREFIX ISSUE_CMD_PREFIX DEBUG GROUP
|
unset SITES_DIR USEREMAIL DOMAIN_FILES DOMAIN_GROUPS DEPLOY_CMD_PREFIX ISSUE_CMD_PREFIX DEBUG GROUP
|
||||||
|
|
||||||
@@ -86,6 +86,25 @@ parse_input() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interactive_dns() {
|
||||||
|
local conf="$HOME/.acme.sh/account.conf"
|
||||||
|
if [[ -f "$conf" ]] && grep -q "CPANELDNS_AUTH_PASSWORD" "$conf"; then
|
||||||
|
echo "cPanel credentials already present, skipping configuration..."
|
||||||
|
echo "To rerun the configuration, first run 'rm $conf'"
|
||||||
|
else
|
||||||
|
read -rp 'Enter your cPanel username: ' CPANELDNS_AUTH_ID
|
||||||
|
echo
|
||||||
|
export CPANELDNS_AUTH_ID
|
||||||
|
read -rp 'Enter your cPanel password: ' CPANELDNS_AUTH_PASSWORD
|
||||||
|
echo
|
||||||
|
export CPANELDNS_AUTH_PASSWORD
|
||||||
|
read -rp 'Enter your cPanel address and port number (example: "https://www.example.com:2083/"): ' CPANELDNS_API
|
||||||
|
echo
|
||||||
|
export CPANELDNS_API
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
get_acme() {
|
get_acme() {
|
||||||
curl https://get.acme.sh | sh
|
curl https://get.acme.sh | sh
|
||||||
source "$HOME/.bashrc"
|
source "$HOME/.bashrc"
|
||||||
@@ -205,6 +224,7 @@ main() {
|
|||||||
update_email
|
update_email
|
||||||
command_prefixes
|
command_prefixes
|
||||||
load_domains
|
load_domains
|
||||||
|
[[ "$METHOD" == "dns" ]] && interactive_dns
|
||||||
issue_and_deploy_certs
|
issue_and_deploy_certs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user