Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dns_scripts/dns_add_cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ fi

# If no existing record, create a new TXT record, otherwise edit the existing record
if [[ "$resp" == *\"data\":[]* ]]; then
request_params="&cpanel_jsonapi_func=add_zone_record&domain=$domain&type=TXT&name=_acme-challenge$name&txtdata=$token"
request_params="&cpanel_jsonapi_func=add_zone_record&domain=${domain}&type=TXT&name=_acme-challenge&txtdata=${token}"
else
# shellcheck disable=SC2001
line=$(echo "$resp" | sed -e 's/.*line":\([0-9]*\),.*/\1/')
request_params="&cpanel_jsonapi_func=edit_zone_record&domain=$domain&type=TXT&name=_acme-challenge$name&txtdata=${token}&line=${line}"
request_params="&cpanel_jsonapi_func=edit_zone_record&domain=${domain}&type=TXT&name=_acme-challenge&txtdata=${token}&line=${line}"
fi
resp=$(curl --silent "${curl_params[@]}" "$request_func$request_params")

Expand Down
2 changes: 1 addition & 1 deletion dns_scripts/dns_del_cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi
line=$(echo "$resp" | sed -e 's/.*line":\([0-9]*\),.*/\1/')
if [[ "$line" != "" ]]; then
# Delete the challenge token
request_params="&cpanel_jsonapi_func=remove_zone_record&domain=$domain&type=TXT&name=_acme-challenge$name&line=$line"
request_params="&cpanel_jsonapi_func=remove_zone_record&domain=${domain}&type=TXT&name=_acme-challenge&line=${line}"
resp=$(curl --silent "${curl_params[@]}" "$request_func$request_params")
fi

Expand Down
3 changes: 2 additions & 1 deletion getssl
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
# 2024-03-26 Test for "true" in wildcard property of authorization responses
# 2024-10-16 Add newlines to /directory response (#765)(#859)
# 2025-06-18 Support profiles
# 2025-07-28 Fix cPanel support for API zone record updates and wildcard domain support
# ----------------------------------------------------------------------------------------

case :$SHELLOPTS: in
Expand All @@ -301,7 +302,7 @@ esac

PROGNAME=${0##*/}
PROGDIR="$(cd "$(dirname "$0")" || exit; pwd -P;)"
VERSION="2.49"
VERSION="2.50"

# defaults
ACCOUNT_KEY_LENGTH=4096
Expand Down
3 changes: 2 additions & 1 deletion other_scripts/cpanel_cert_upload
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# use with RELOAD_CMD="${HOME}/cpanel_cert_upload domain.com"

domain="$1"
nowild=$(echo "${1//\*\./}")

rawurlencode() {
local string
Expand All @@ -28,4 +29,4 @@ ecert=$( rawurlencode "${HOME}/.getssl/${domain}/${domain}.crt" )
ekey=$( rawurlencode "${HOME}/.getssl/${domain}/${domain}.key" )
echain=$( rawurlencode "${HOME}/.getssl/${domain}/chain.crt" )

uapi SSL install_ssl domain="${domain}" cert="${ecert}" key="${ekey}" cabundle="${echain}"
uapi SSL install_ssl domain="${nowild}" cert="${ecert}" key="${ekey}" cabundle="${echain}"