Make inline file failure only a warning

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-04-28 14:25:20 +01:00
parent 0248064235
commit fac4abf074
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1362,15 +1362,20 @@ Matching file found at: "
# inline it
if [ "$EASYRSA_INLINE" ]; then
inline_creds
inline_file="$EASYRSA_PKI/$EASYRSA_REQ_CN.creds"
if [ -f "$inline_file" ]; then
warn "Inline file exists not over-writing: $inline_file"
else
inline_creds || die "Failed to write inline file: $inline_file"
notice "\
Inline file created: $inline_file"
fi
fi
} # => build_full()
# Create inline credentials file for this node
inline_creds ()
{
[ -f "$EASYRSA_PKI/$EASYRSA_REQ_CN.creds" ] \
&& die "Inline file exists: $EASYRSA_PKI/$EASYRSA_REQ_CN.creds"
{
printf "%s\n" "# $crt_type: $EASYRSA_REQ_CN"
printf "%s\n" ""
@ -1386,7 +1391,7 @@ inline_creds ()
cat "$key_out"
printf "%s\n" "</key>"
printf "%s\n" ""
} > "$EASYRSA_PKI/$EASYRSA_REQ_CN.creds"
} > "$inline_file"
} # => inline_creds ()
# revoke backend