summaryrefslogtreecommitdiff
path: root/scripts/vyatta-gen-x509-keypair.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-gen-x509-keypair.sh.in')
-rwxr-xr-xscripts/vyatta-gen-x509-keypair.sh.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/vyatta-gen-x509-keypair.sh.in b/scripts/vyatta-gen-x509-keypair.sh.in
new file mode 100755
index 0000000..194ac4f
--- /dev/null
+++ b/scripts/vyatta-gen-x509-keypair.sh.in
@@ -0,0 +1,11 @@
+#!/bin/bash
+CN=$1
+genkeypair (){
+ openssl req -new -nodes -keyout /config/auth/$CN.key -out /config/auth/$CN.csr -config @sysconfdir@/key-pair.template
+}
+if [ -f /config/auth/$CN.csr ]; then
+ read -p "A certificate request named $CN.csr already exists. Overwrite (y/n)?"
+ [[ $REPLY != y && $REPLY != Y ]] || genkeypair
+else
+ genkeypair
+fi