summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2015-03-31 09:23:50 +0200
committerFredrik Thulin <fredrik@thulin.net>2015-03-31 09:23:50 +0200
commit17d595dc4e90d6b64ed75de11c04236a2444fa0c (patch)
tree0f68a51ea7f2d0da1f53121413e0eae984273625 /scripts
parent0fc39fd18b57d9fe651d9a176927e5ae3eb517ed (diff)
Remove generated key from disk, after printing it.sunet-ops-2015-03-31-v03
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkreq8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/mkreq b/scripts/mkreq
index 2b59f52..44aaddc 100755
--- a/scripts/mkreq
+++ b/scripts/mkreq
@@ -15,7 +15,7 @@ Usage: mkreq [-v] [-s*] [-c] [-C <ca host>] [-N <ca name>] [--] <fqdn>
-c request client cert
-C ca host (ca.sunet.se)
-N ca name (infra)
-
+
<fqdn> fully qualified name of host
" 1>&2
@@ -110,6 +110,12 @@ git add "$reqs/$host.csr" && git commit -m "certification request for $host from
if [ -d $host ]; then
ssh root@$host mkdir -p /etc/ssl/private && scp "$key" "root@$host:/etc/ssl/private/${host}_${ca_name}.key" && rm -f "$key" && echo "** private key given to $host" || echo "** private key left in $key - should be in root@$host:/etc/ssl/private/${host}_${ca_name}.key"
+else
+ echo ""
+ echo "** Generated the following RSA key, keep it safe:"
+ cat $key
+ rm -f $key
+ echo ""
fi
echo "** successfully generated key and certification request for $host from $ca_host:$ca_name"