diff --git a/simple-ca.sh b/simple-ca.sh index 4ee7e0f..62a5832 100755 --- a/simple-ca.sh +++ b/simple-ca.sh @@ -85,11 +85,16 @@ function make_ca() { local CA_NAME="$2" shift 2 - if [[ -z "$CA_DIR" || -z "$CA_NAME" || ! -d "$CA_DIR" ]]; then + if [[ -z "$CA_DIR" || ! -d "$CA_DIR" ]]; then echo "ERROR: Certificate directory $CA_DIR does not exist." return 1 fi + if [[ -z "$CA_NAME" ]]; then + echo "ERROR: CA name is required." >&2 + return 1 + fi + if [[ -z "$AIA_BASE_URL" && -f "$CA_DIR/aia_base_url.txt" ]]; then AIA_BASE_URL="$(cat "$CA_DIR/aia_base_url.txt")" fi