mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-12 08:02:41 +02: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
@@ -1773,6 +1773,22 @@ command_revoke() {
|
|||||||
mv -f "${cert}" "${cert}-revoked"
|
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)
|
# Usage: --cleanup (-gc)
|
||||||
# Description: Move unused certificate files to archive directory
|
# Description: Move unused certificate files to archive directory
|
||||||
command_cleanup() {
|
command_cleanup() {
|
||||||
@@ -1925,6 +1941,10 @@ main() {
|
|||||||
PARAM_REVOKECERT="${1}"
|
PARAM_REVOKECERT="${1}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--deactivate)
|
||||||
|
set_command deactivate
|
||||||
|
;;
|
||||||
|
|
||||||
--version|-v)
|
--version|-v)
|
||||||
set_command version
|
set_command version
|
||||||
;;
|
;;
|
||||||
@@ -2087,6 +2107,7 @@ main() {
|
|||||||
account) command_account;;
|
account) command_account;;
|
||||||
sign_csr) command_sign_csr "${PARAM_CSR}";;
|
sign_csr) command_sign_csr "${PARAM_CSR}";;
|
||||||
revoke) command_revoke "${PARAM_REVOKECERT}";;
|
revoke) command_revoke "${PARAM_REVOKECERT}";;
|
||||||
|
deactivate) command_deactivate;;
|
||||||
cleanup) command_cleanup;;
|
cleanup) command_cleanup;;
|
||||||
version) command_version;;
|
version) command_version;;
|
||||||
*) command_help; exit 1;;
|
*) command_help; exit 1;;
|
||||||
|
|||||||
Reference in New Issue
Block a user