summaryrefslogtreecommitdiff
path: root/scripts/vyatta-gen-x509-keypair.in
blob: 194ac4fda5c6d717caf3b24fac3936188b048cb0 (plain)
1
2
3
4
5
6
7
8
9
10
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