mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-22 13:11:41 +00:00
commit
f60dde4138
@ -2,8 +2,12 @@
|
|||||||
# Here is the script to deploy the cert to your cpanel using the cpanel API.
|
# Here is the script to deploy the cert to your cpanel using the cpanel API.
|
||||||
# Uses command line uapi. --user option is needed only if run as root.
|
# Uses command line uapi. --user option is needed only if run as root.
|
||||||
# Returns 0 when success.
|
# Returns 0 when success.
|
||||||
# Written by Santeri Kannisto <santeri.kannisto@2globalnomads.info>
|
#
|
||||||
# Public domain, 2017
|
# Please note that I am no longer using Github. If you want to report an issue
|
||||||
|
# or contact me, visit https://forum.webseodesigners.com/web-design-seo-and-hosting-f16/
|
||||||
|
#
|
||||||
|
# Written by Santeri Kannisto <santeri.kannisto@webseodesigners.com>
|
||||||
|
# Public domain, 2017-2018
|
||||||
|
|
||||||
#export DEPLOY_CPANEL_USER=myusername
|
#export DEPLOY_CPANEL_USER=myusername
|
||||||
|
|
||||||
@ -28,15 +32,9 @@ cpanel_uapi_deploy() {
|
|||||||
_err "The command uapi is not found."
|
_err "The command uapi is not found."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if ! _exists php; then
|
|
||||||
_err "The command php is not found."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
# read cert and key files and urlencode both
|
# read cert and key files and urlencode both
|
||||||
_certstr=$(cat "$_ccert")
|
_cert=$(_url_encode <"$_ccert")
|
||||||
_keystr=$(cat "$_ckey")
|
_key=$(_url_encode <"$_ckey")
|
||||||
_cert=$(php -r "echo urlencode(\"$_certstr\");")
|
|
||||||
_key=$(php -r "echo urlencode(\"$_keystr\");")
|
|
||||||
|
|
||||||
_debug _cert "$_cert"
|
_debug _cert "$_cert"
|
||||||
_debug _key "$_key"
|
_debug _key "$_key"
|
||||||
|
@ -128,7 +128,7 @@ _ISPC_addTxt() {
|
|||||||
curSerial="$(date +%s)"
|
curSerial="$(date +%s)"
|
||||||
curStamp="$(date +'%F %T')"
|
curStamp="$(date +'%F %T')"
|
||||||
params="\"server_id\":\"${server_id}\",\"zone\":\"${zone}\",\"name\":\"${fulldomain}.\",\"type\":\"txt\",\"data\":\"${txtvalue}\",\"aux\":\"0\",\"ttl\":\"3600\",\"active\":\"y\",\"stamp\":\"${curStamp}\",\"serial\":\"${curSerial}\""
|
params="\"server_id\":\"${server_id}\",\"zone\":\"${zone}\",\"name\":\"${fulldomain}.\",\"type\":\"txt\",\"data\":\"${txtvalue}\",\"aux\":\"0\",\"ttl\":\"3600\",\"active\":\"y\",\"stamp\":\"${curStamp}\",\"serial\":\"${curSerial}\""
|
||||||
curData="{\"session_id\":\"${sessionID}\",\"client_id\":\"${client_id}\",\"params\":{${params}}}"
|
curData="{\"session_id\":\"${sessionID}\",\"client_id\":\"${client_id}\",\"params\":{${params}},\"update_serial\":true}"
|
||||||
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_add")"
|
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_add")"
|
||||||
_debug "Calling _ISPC_addTxt: '${curData}' '${ISPC_Api}?dns_txt_add'"
|
_debug "Calling _ISPC_addTxt: '${curData}' '${ISPC_Api}?dns_txt_add'"
|
||||||
_debug "Result of _ISPC_addTxt: '$curResult'"
|
_debug "Result of _ISPC_addTxt: '$curResult'"
|
||||||
@ -160,7 +160,7 @@ _ISPC_rmTxt() {
|
|||||||
*)
|
*)
|
||||||
unset IFS
|
unset IFS
|
||||||
_info "Retrieved Record ID."
|
_info "Retrieved Record ID."
|
||||||
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${record_id}\"}"
|
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${record_id}\",\"update_serial\":true}"
|
||||||
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_delete")"
|
curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_delete")"
|
||||||
_debug "Calling _ISPC_rmTxt: '${curData}' '${ISPC_Api}?dns_txt_delete'"
|
_debug "Calling _ISPC_rmTxt: '${curData}' '${ISPC_Api}?dns_txt_delete'"
|
||||||
_debug "Result of _ISPC_rmTxt: '$curResult'"
|
_debug "Result of _ISPC_rmTxt: '$curResult'"
|
||||||
|
Loading…
Reference in New Issue
Block a user