mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-08 05:55:18 +02:00
Complain about deactivated accounts
This commit is contained in:
committed by
Lukas Schauer
parent
308b3ec750
commit
8ddead4854
+12
-1
@@ -474,6 +474,11 @@ load_config() {
|
|||||||
ACCOUNT_KEY="${ACCOUNTDIR}/${CAHASH}/account_key.pem"
|
ACCOUNT_KEY="${ACCOUNTDIR}/${CAHASH}/account_key.pem"
|
||||||
ACCOUNT_KEY_JSON="${ACCOUNTDIR}/${CAHASH}/registration_info.json"
|
ACCOUNT_KEY_JSON="${ACCOUNTDIR}/${CAHASH}/registration_info.json"
|
||||||
ACCOUNT_ID_JSON="${ACCOUNTDIR}/${CAHASH}/account_id.json"
|
ACCOUNT_ID_JSON="${ACCOUNTDIR}/${CAHASH}/account_id.json"
|
||||||
|
ACCOUNT_DEACTIVATED="${ACCOUNTDIR}/${CAHASH}/deactivated"
|
||||||
|
|
||||||
|
if [[ -f "${ACCOUNT_DEACTIVATED}" ]]; then
|
||||||
|
_exiterr "Account has been deactivated. Remove account and create a new one using --register."
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -f "${BASEDIR}/private_key.pem" ]] && [[ ! -f "${ACCOUNT_KEY}" ]]; then
|
if [[ -f "${BASEDIR}/private_key.pem" ]] && [[ ! -f "${ACCOUNT_KEY}" ]]; then
|
||||||
echo "! Moving private_key.pem to ${ACCOUNT_KEY}"
|
echo "! Moving private_key.pem to ${ACCOUNT_KEY}"
|
||||||
@@ -1778,12 +1783,18 @@ command_revoke() {
|
|||||||
command_deactivate() {
|
command_deactivate() {
|
||||||
init_system
|
init_system
|
||||||
|
|
||||||
echo "Deactivating account $ACCOUNT_URL"
|
echo "Deactivating account ${ACCOUNT_URL}"
|
||||||
|
|
||||||
if [[ ${API} -eq 1 ]]; then
|
if [[ ${API} -eq 1 ]]; then
|
||||||
echo "Deactivation for ACMEv1 is not implemented"
|
echo "Deactivation for ACMEv1 is not implemented"
|
||||||
else
|
else
|
||||||
response="$(signed_request "${ACCOUNT_URL}" '{"status": "deactivated"}' | clean_json)"
|
response="$(signed_request "${ACCOUNT_URL}" '{"status": "deactivated"}' | clean_json)"
|
||||||
|
deactstatus=$(echo "$response" | jsonsh | get_json_string_value "status")
|
||||||
|
if [[ "${deactstatus}" = "deactivated" ]]; then
|
||||||
|
touch "${ACCOUNT_DEACTIVATED}"
|
||||||
|
else
|
||||||
|
_exiterr "Account deactivation failed!"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " + Done."
|
echo " + Done."
|
||||||
|
|||||||
Reference in New Issue
Block a user