create-certificates: Use 'hostname' intead of hard-coded ucentral

This lets the keys work on my machine, who's hostname was not ucentral

Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
Ben Greear
2021-04-10 15:36:00 -07:00
parent ef9f4aba3a
commit 1bea58d4fe

View File

@@ -1,8 +1,9 @@
#!/bin/bash
hn=$(hostname)
howmany=10
cert_life=365
subject="/C=CA/ST=British Columbia/L=Vancouver/O=Arilia Wireless/OU=Engineering/CN=ucentral/emailAddress=support@example.com"
subject="/C=CA/ST=British Columbia/L=Vancouver/O=Arilia Wireless/OU=Engineering/CN=$hn/emailAddress=support@example.com"
openssl genrsa -out server-key.pem 2048
openssl req -new -key server-key.pem -subj "$subject" -out server.csr
@@ -11,4 +12,4 @@ openssl x509 -req -days $cert_life -in server.csr -signkey server-key.pem -out s
for i in `eval echo {1..$howmany}`
do
openssl x509 -signkey server-key.pem -in server.csr -req -days $cert_life -out dev-$i-cert.pem
done
done