From: Fredrik Tolf Date: Sat, 24 Mar 2018 00:23:21 +0000 (+0100) Subject: Slightly dubious certreq adjustments. X-Git-Url: http://dolda2000.com/gitweb/?p=utils.git;a=commitdiff_plain;h=f3768fd2a1161cf3cc7e67f002cb0055f9defd05 Slightly dubious certreq adjustments. --- diff --git a/certreq b/certreq index fb7e26c..142644e 100755 --- a/certreq +++ b/certreq @@ -1,5 +1,14 @@ #!/bin/bash +commajoin() { + f=y + for arg in "$@"; do + if [ -z "$f" ]; then echo -n ,; fi + echo -n "$arg" + f= + done +} + usage() { echo "usage: certreq [-h] [-a ALTNAMES] SUBJECT KEYFILE" echo ' SUBJECT is of the form `/PART1=VALUE1/PART2=VALUE2/...'\' @@ -28,7 +37,9 @@ fi args=(openssl req -new) if [ -n "${!reqexts[*]}" ]; then - args=("${args[@]}" -reqexts "${!reqexts[@]}") + for reqext in "${!reqexts[@]}"; do + args=("${args[@]}" -reqexts "$reqext") + done fi if [ -n "${!config[*]}" ]; then confpath="$(mktemp /tmp/certreq-XXXXXX)"