|
@ -1,6 +1,5 @@ |
|
|
#!/usr/bin/env sh |
|
|
#!/usr/bin/env sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Applcation Key |
|
|
#Applcation Key |
|
|
#OVH_AK="sdfsdfsdfljlbjkljlkjsdfoiwje" |
|
|
#OVH_AK="sdfsdfsdfljlbjkljlkjsdfoiwje" |
|
|
# |
|
|
# |
|
@ -10,10 +9,8 @@ |
|
|
#Consumer Key |
|
|
#Consumer Key |
|
|
#OVH_CK="sdfsdfsdfsdfsdfdsf" |
|
|
#OVH_CK="sdfsdfsdfsdfsdfdsf" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#OVH_END_POINT=ovh-eu |
|
|
#OVH_END_POINT=ovh-eu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#'ovh-eu' |
|
|
#'ovh-eu' |
|
|
OVH_EU='https://eu.api.ovh.com/1.0' |
|
|
OVH_EU='https://eu.api.ovh.com/1.0' |
|
|
|
|
|
|
|
@ -35,13 +32,10 @@ SYS_CA='https://ca.api.soyoustart.com/1.0' |
|
|
#'runabove-ca' |
|
|
#'runabove-ca' |
|
|
RAV_CA='https://api.runabove.com/1.0' |
|
|
RAV_CA='https://api.runabove.com/1.0' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wiki="https://github.com/Neilpang/acme.sh/wiki/How-to-use-OVH-domain-api" |
|
|
wiki="https://github.com/Neilpang/acme.sh/wiki/How-to-use-OVH-domain-api" |
|
|
|
|
|
|
|
|
ovh_success="https://github.com/Neilpang/acme.sh/wiki/OVH-Success" |
|
|
ovh_success="https://github.com/Neilpang/acme.sh/wiki/OVH-Success" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_ovh_get_api() { |
|
|
_ovh_get_api() { |
|
|
_ogaep="$1" |
|
|
_ogaep="$1" |
|
|
|
|
|
|
|
@ -76,8 +70,8 @@ _ovh_get_api() { |
|
|
return |
|
|
return |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*) |
|
|
*) |
|
|
|
|
|
|
|
|
_err "Unknown parameter : $1" |
|
|
_err "Unknown parameter : $1" |
|
|
return 1 |
|
|
return 1 |
|
|
;; |
|
|
;; |
|
@ -101,7 +95,6 @@ dns_ovh_add(){ |
|
|
_saveaccountconf OVH_AK "$OVH_AK" |
|
|
_saveaccountconf OVH_AK "$OVH_AK" |
|
|
_saveaccountconf OVH_AS "$OVH_AS" |
|
|
_saveaccountconf OVH_AS "$OVH_AS" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$OVH_END_POINT" ]; then |
|
|
if [ -z "$OVH_END_POINT" ]; then |
|
|
OVH_END_POINT="ovh-eu" |
|
|
OVH_END_POINT="ovh-eu" |
|
|
fi |
|
|
fi |
|
@ -119,10 +112,9 @@ dns_ovh_add(){ |
|
|
_err "Can not get consumer key." |
|
|
_err "Can not get consumer key." |
|
|
fi |
|
|
fi |
|
|
#return and wait for retry. |
|
|
#return and wait for retry. |
|
|
return 1; |
|
|
|
|
|
|
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_info "Checking authentication" |
|
|
_info "Checking authentication" |
|
|
|
|
|
|
|
|
response="$(_ovh_rest GET "domain/")" |
|
|
response="$(_ovh_rest GET "domain/")" |
|
@ -173,7 +165,7 @@ dns_ovh_add(){ |
|
|
_debug "Refresh:$response" |
|
|
_debug "Refresh:$response" |
|
|
_info "Updated, sleeping 10 seconds" |
|
|
_info "Updated, sleeping 10 seconds" |
|
|
sleep 10 |
|
|
sleep 10 |
|
|
return 0; |
|
|
|
|
|
|
|
|
return 0 |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
_err "Update error" |
|
|
_err "Update error" |
|
@ -182,14 +174,12 @@ dns_ovh_add(){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#fulldomain |
|
|
#fulldomain |
|
|
dns_ovh_rm() { |
|
|
dns_ovh_rm() { |
|
|
fulldomain=$1 |
|
|
fulldomain=$1 |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#################### Private functions bellow ################################## |
|
|
#################### Private functions bellow ################################## |
|
|
|
|
|
|
|
|
_ovh_authentication() { |
|
|
_ovh_authentication() { |
|
@ -227,7 +217,6 @@ _ovh_authentication() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#_acme-challenge.www.domain.com |
|
|
#_acme-challenge.www.domain.com |
|
|
#returns |
|
|
#returns |
|
|
# _sub_domain=_acme-challenge.www |
|
|
# _sub_domain=_acme-challenge.www |
|
@ -241,7 +230,7 @@ _get_root() { |
|
|
h=$(printf $domain | cut -d . -f $i-100) |
|
|
h=$(printf $domain | cut -d . -f $i-100) |
|
|
if [ -z "$h" ]; then |
|
|
if [ -z "$h" ]; then |
|
|
#not valid |
|
|
#not valid |
|
|
return 1; |
|
|
|
|
|
|
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if ! _ovh_rest GET "domain/zone/$h"; then |
|
|
if ! _ovh_rest GET "domain/zone/$h"; then |
|
@ -274,7 +263,6 @@ _ovh_rest() { |
|
|
data="$3" |
|
|
data="$3" |
|
|
_debug $ep |
|
|
_debug $ep |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_ovh_url="$OVH_API/$ep" |
|
|
_ovh_url="$OVH_API/$ep" |
|
|
_debug2 _ovh_url "$_ovh_url" |
|
|
_debug2 _ovh_url "$_ovh_url" |
|
|
_ovh_t="$(_ovh_timestamp)" |
|
|
_ovh_t="$(_ovh_timestamp)" |
|
@ -284,7 +272,6 @@ _ovh_rest() { |
|
|
_ovh_hex="$(printf "%s" "$_ovh_p" | _digest sha1 hex)" |
|
|
_ovh_hex="$(printf "%s" "$_ovh_p" | _digest sha1 hex)" |
|
|
_debug2 _ovh_hex "$_ovh_hex" |
|
|
_debug2 _ovh_hex "$_ovh_hex" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_H1="X-Ovh-Application: $OVH_AK" |
|
|
_H1="X-Ovh-Application: $OVH_AK" |
|
|
_H2="X-Ovh-Signature: \$1\$$_ovh_hex" |
|
|
_H2="X-Ovh-Signature: \$1\$$_ovh_hex" |
|
|
_debug2 _H2 "$_H2" |
|
|
_debug2 _H2 "$_H2" |
|
@ -305,5 +292,3 @@ _ovh_rest() { |
|
|
_debug2 response "$response" |
|
|
_debug2 response "$response" |
|
|
return 0 |
|
|
return 0 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|