mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-25 02:21:02 +01:00
implement account deactivation through --deactivate parameter
This is an updated version of https://github.com/lukas2511/dehydrated/files/2641548/dehydrated_add_deactivate_command.diff.txt Fixes #216
This commit is contained in:
committed by
Lukas Schauer
parent
39e1068a87
commit
308b3ec750
21
dehydrated
21
dehydrated
@@ -1773,6 +1773,22 @@ command_revoke() {
|
||||
mv -f "${cert}" "${cert}-revoked"
|
||||
}
|
||||
|
||||
# Usage: --deactivate
|
||||
# Description: Deactivate account
|
||||
command_deactivate() {
|
||||
init_system
|
||||
|
||||
echo "Deactivating account $ACCOUNT_URL"
|
||||
|
||||
if [[ ${API} -eq 1 ]]; then
|
||||
echo "Deactivation for ACMEv1 is not implemented"
|
||||
else
|
||||
response="$(signed_request "${ACCOUNT_URL}" '{"status": "deactivated"}' | clean_json)"
|
||||
fi
|
||||
|
||||
echo " + Done."
|
||||
}
|
||||
|
||||
# Usage: --cleanup (-gc)
|
||||
# Description: Move unused certificate files to archive directory
|
||||
command_cleanup() {
|
||||
@@ -1925,6 +1941,10 @@ main() {
|
||||
PARAM_REVOKECERT="${1}"
|
||||
;;
|
||||
|
||||
--deactivate)
|
||||
set_command deactivate
|
||||
;;
|
||||
|
||||
--version|-v)
|
||||
set_command version
|
||||
;;
|
||||
@@ -2087,6 +2107,7 @@ main() {
|
||||
account) command_account;;
|
||||
sign_csr) command_sign_csr "${PARAM_CSR}";;
|
||||
revoke) command_revoke "${PARAM_REVOKECERT}";;
|
||||
deactivate) command_deactivate;;
|
||||
cleanup) command_cleanup;;
|
||||
version) command_version;;
|
||||
*) command_help; exit 1;;
|
||||
|
||||
Reference in New Issue
Block a user