From 23d645c1a6a8e70e17296cd55f04502b7e08a3db Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 26 Mar 2015 19:46:59 +0100 Subject: mkreq --- scripts/mkreq | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 6 deletions(-) (limited to 'scripts/mkreq') diff --git a/scripts/mkreq b/scripts/mkreq index c73d598..4493867 100755 --- a/scripts/mkreq +++ b/scripts/mkreq @@ -1,7 +1,68 @@ #!/bin/sh -mkdir -p $1 -cat>/tmp/mkreq-$$.cf<] [-N ] [--] + + + -h, --help show this help text and exit + -s request server cert (default if exists in cosmos repo) + -c request client cert + -C ca host (ca.sunet.se) + -N ca name (infra) + + fully qualified name of host + +" 1>&2 +} + +{ + while test $# -gt 0; do + case "$1" in + -s) + type="server" + ;; + -c) + type="client" + ;; + -C) + ca_host="$2" + shift + ;; + -N) + ca_name="$2" + shift + ;; + -h) + usage + exit 0 + ;; + --) + break + ;; + esac + shift + done +} + +if [ -d $host -a -z $type ]; then + type="server" +fi + + +cfg=`mktemp` +key="/tmp/$host.key" +csr="/tmp/$host.csr" + +trap 'rm -f $cfg' EXIT + +cat>$cfg<