Commit a78c1d11 authored by Vincent Pelletier's avatar Vincent Pelletier

contrib/shell/kedifa_generateauth: Do not fail silently when kedifa does not provide an identifier

Also, make the output a bit nicer.
parent 95811b55
...@@ -58,11 +58,16 @@ else ...@@ -58,11 +58,16 @@ else
fi fi
trap 'rm "${outfile}"' EXIT trap 'rm "${outfile}"' EXIT
chmod go= "$outfile" chmod go= "$outfile"
echo -n "Retrieving kedifa identifier for shared instance..." echo -n "Retrieving kedifa identifier for shared instance... "
kedifa_auth="$(curl --silent --cacert "${cafile}" --crlfile "${crlfile}" "${kedifa_url_base}/generateauth")" if kedifa_auth="$(curl --silent --fail --cacert "${cafile}" --crlfile "${crlfile}" "${kedifa_url_base}/generateauth")"; then
:
else
echo "failed: kedifa did not provide an identifier"
exit 1
fi
trap - EXIT trap - EXIT
printf 'CA=%q\nCRL=%q\nURL=%q\n' "$cafile" "$crlfile" "${kedifa_url_base}?auth=${kedifa_auth}" > "$outfile" printf 'CA=%q\nCRL=%q\nURL=%q\n' "$cafile" "$crlfile" "${kedifa_url_base}?auth=${kedifa_auth}" > "$outfile"
echo " done." echo "done."
if curl --output /dev/null --silent "https://$domain"; then if curl --output /dev/null --silent "https://$domain"; then
: :
elif [ 35 -eq $? ]; then elif [ 35 -eq $? ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment