🐛 prohibit clientmgmt commands before init is done

This commit is contained in:
DrMaxNix 2024-08-27 20:26:28 +02:00
parent 49a12e960c
commit 9ef9efb1a6

View File

@ -363,19 +363,32 @@ clientmgmt_clientlist(){
#
# HELPER: Make sure config and key files have been fully initialized.
#
clientmgmt_check_init_done(){
[[ -f "${DATA_SERVER_DIR}/server.conf" ]] && return 0
log_error "Server is still initializing config and key files; try again in a few seconds"
}
## MAIN ##
case ${1:-""} in
add)
clientmgmt_check_init_done
clientmgmt_add
exit 0
;;
list)
clientmgmt_check_init_done
clientmgmt_list
exit 0
;;
revoke)
clientmgmt_check_init_done
clientmgmt_revoke
exit 0
;;