diff --git a/clientmgmt b/clientmgmt index 6637aa3..a6d43b8 100755 --- a/clientmgmt +++ b/clientmgmt @@ -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 ;;