mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-10 07:02:56 +00:00
Merge 7dcc9b048155853e63616e92641f332e51764624 into 206be3c1619a699af3e53636935e64f51493cd2f
This commit is contained in:
commit
cc4363ee69
@ -2,11 +2,30 @@
|
|||||||
# 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>
|
# Written by Santeri Kannisto <santeri.kannisto@webseodesigners.com>
|
||||||
# Public domain, 2017
|
# Public domain, 2017
|
||||||
|
|
||||||
#export DEPLOY_CPANEL_USER=myusername
|
#export DEPLOY_CPANEL_USER=myusername
|
||||||
|
|
||||||
|
######## Private functions #####################
|
||||||
|
|
||||||
|
__urlencode() {
|
||||||
|
local string="${1}"
|
||||||
|
local strlen=${#string}
|
||||||
|
local encoded=""
|
||||||
|
local pos c o
|
||||||
|
|
||||||
|
for (( pos=0 ; pos<strlen ; pos++ )); do
|
||||||
|
c=${string:$pos:1}
|
||||||
|
case "$c" in
|
||||||
|
[-_.~a-zA-Z0-9] ) o="${c}" ;;
|
||||||
|
*) printf -v o '%%%02x' "'$c"
|
||||||
|
esac
|
||||||
|
encoded+="${o}"
|
||||||
|
done
|
||||||
|
echo "${encoded}"
|
||||||
|
}
|
||||||
|
|
||||||
######## Public functions #####################
|
######## Public functions #####################
|
||||||
|
|
||||||
#domain keyfile certfile cafile fullchain
|
#domain keyfile certfile cafile fullchain
|
||||||
@ -35,8 +54,8 @@ cpanel_uapi_deploy() {
|
|||||||
# read cert and key files and urlencode both
|
# read cert and key files and urlencode both
|
||||||
_certstr=$(cat "$_ccert")
|
_certstr=$(cat "$_ccert")
|
||||||
_keystr=$(cat "$_ckey")
|
_keystr=$(cat "$_ckey")
|
||||||
_cert=$(php -r "echo urlencode(\"$_certstr\");")
|
_cert=$(__urlencode "$_certstr")
|
||||||
_key=$(php -r "echo urlencode(\"$_keystr\");")
|
_key=$(__urlencode "$_keystr")
|
||||||
|
|
||||||
_debug _cert "$_cert"
|
_debug _cert "$_cert"
|
||||||
_debug _key "$_key"
|
_debug _key "$_key"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user