mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-05 18:54:55 +00:00
some minor corrections
This commit is contained in:
parent
33bc5d95d8
commit
ee81ef9136
@ -47,11 +47,11 @@ _ISPC_login() {
|
|||||||
sessionID=${sessionID:1:-2}
|
sessionID=${sessionID:1:-2}
|
||||||
_info "Successfully retrieved Session ID."
|
_info "Successfully retrieved Session ID."
|
||||||
else
|
else
|
||||||
_err "Couldn't retrieve the Session ID. Aborting.";
|
_err "Couldn't retrieve the Session ID."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_ISPC_getZoneInfo () {
|
_ISPC_getZoneInfo() {
|
||||||
_info "Getting Zoneinfo"
|
_info "Getting Zoneinfo"
|
||||||
zoneEnd=false
|
zoneEnd=false
|
||||||
curZone="${fulldomain}"
|
curZone="${fulldomain}"
|
||||||
@ -68,26 +68,26 @@ _ISPC_getZoneInfo () {
|
|||||||
_debug2 "$curZone still contains a '.' - so we can check next higher level"
|
_debug2 "$curZone still contains a '.' - so we can check next higher level"
|
||||||
else
|
else
|
||||||
zoneEnd=true
|
zoneEnd=true
|
||||||
_err "Couldn't retrieve zone info. Aborting."
|
_err "Couldn't retrieve zone info."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ ${zoneFound} ]; then
|
if [ ${zoneFound} ]; then
|
||||||
server_id=$(echo "${curResult}" | _egrep_o "server_id.*" | cut -d ':' -f 2)
|
server_id=$(echo "${curResult}" | _egrep_o "server_id.*" | cut -d ':' -f 2)
|
||||||
server_id=${server_id:1:-10}
|
server_id=${server_id:1:-10}
|
||||||
case ${server_id} in
|
case ${server_id} in
|
||||||
''|*[!0-9]*) _err "Server ID is not numeric. Aborting" ;;
|
''|*[!0-9]*) _err "Server ID is not numeric." ;;
|
||||||
*) _info "Successfully retrieved Server ID" ;;
|
*) _info "Successfully retrieved Server ID" ;;
|
||||||
esac
|
esac
|
||||||
zone=$(echo "${curResult}" | _egrep_o "\"id.*" | cut -d ':' -f 2)
|
zone=$(echo "${curResult}" | _egrep_o "\"id.*" | cut -d ':' -f 2)
|
||||||
zone=${zone:1:-14}
|
zone=${zone:1:-14}
|
||||||
case ${zone} in
|
case ${zone} in
|
||||||
''|*[!0-9]*) _err "Zone ID is not numeric. Aborting" ;;
|
''|*[!0-9]*) _err "Zone ID is not numeric." ;;
|
||||||
*) _info "Successfully retrieved Zone ID" ;;
|
*) _info "Successfully retrieved Zone ID" ;;
|
||||||
esac
|
esac
|
||||||
client_id=$(echo "${curResult}" | _egrep_o "sys_userid.*" | cut -d ':' -f 2)
|
client_id=$(echo "${curResult}" | _egrep_o "sys_userid.*" | cut -d ':' -f 2)
|
||||||
client_id=${client_id:1:-15}
|
client_id=${client_id:1:-15}
|
||||||
case ${client_id} in
|
case ${client_id} in
|
||||||
''|*[!0-9]*) _err "Client ID is not numeric. Aborting" ;;
|
''|*[!0-9]*) _err "Client ID is not numeric." ;;
|
||||||
*) _info "Successfully retrieved Client ID" ;;
|
*) _info "Successfully retrieved Client ID" ;;
|
||||||
esac
|
esac
|
||||||
unset zoneFound
|
unset zoneFound
|
||||||
@ -95,7 +95,7 @@ _ISPC_getZoneInfo () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_ISPC_addTxt () {
|
_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}\""
|
||||||
@ -104,18 +104,18 @@ _ISPC_addTxt () {
|
|||||||
record_id=$(echo "${curResult}" | _egrep_o "\"response.*" | cut -d ':' -f 2)
|
record_id=$(echo "${curResult}" | _egrep_o "\"response.*" | cut -d ':' -f 2)
|
||||||
record_id=${record_id:1:-2}
|
record_id=${record_id:1:-2}
|
||||||
case ${record_id} in
|
case ${record_id} in
|
||||||
''|*[!0-9]*) _err "Record ID is not numeric. Aborting" ;;
|
''|*[!0-9]*) _err "Record ID is not numeric." ;;
|
||||||
*) _info "Successfully retrieved Record ID";
|
*) _info "Successfully retrieved Record ID";
|
||||||
record_data="$record_data $record_id" ;; # Make space seperated string of record IDs for later removal.
|
record_data="$record_data $record_id" ;; # Make space seperated string of record IDs for later removal.
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_ISPC_rmTxt () {
|
_ISPC_rmTxt() {
|
||||||
IFS=" "
|
IFS=" "
|
||||||
for i in $record_data; do
|
for i in $record_data; do
|
||||||
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${i}\"}"
|
curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${i}\"}"
|
||||||
curResult=$(curl -k --data "${curData}" "${ISPC_Api}?dns_txt_delete")
|
curResult=$(curl -k --data "${curData}" "${ISPC_Api}?dns_txt_delete")
|
||||||
if _contains "${curResult}" '"code":"ok"'; then
|
if _contains "${curResult}" '"code":"ok"'; then
|
||||||
_info "Successfully removed ACME challenge txt record."
|
_info "Successfully removed ACME challenge txt record."
|
||||||
else
|
else
|
||||||
_debug "Couldn't remove ACME challenge txt record"; # Setting it to debug only because there's no harm if the txt remains
|
_debug "Couldn't remove ACME challenge txt record"; # Setting it to debug only because there's no harm if the txt remains
|
||||||
|
Loading…
x
Reference in New Issue
Block a user