changed sslcreate function
This commit is contained in:
parent
6fbbadb440
commit
0edc458812
1 changed files with 10 additions and 3 deletions
|
@ -13,9 +13,16 @@ pclear () {
|
||||||
|
|
||||||
# Create SSL One Line
|
# Create SSL One Line
|
||||||
sslcreate() {
|
sslcreate() {
|
||||||
openssl genrsa -out private/$1.key 2048
|
if [[ "$1" = "create" ]]; then
|
||||||
openssl req -new -key private/$1.key -out csr/$1.csr -sha256
|
openssl genrsa -out private/$2.key 2048
|
||||||
openssl x509 -req -days 365 -in csr/$1.csr -signkey private/$1.key -out certs/$1.crt
|
openssl req -new -key private/$2.key -out csr/$2.csr -sha256
|
||||||
|
openssl x509 -req -days 365 -in csr/$2.csr -signkey private/$2.key -out certs/$2.crt
|
||||||
|
fi
|
||||||
|
if [[ "$1" = "clear" ]]; then
|
||||||
|
rm -rf private/$2.key
|
||||||
|
rm -rf csr/$2.csr
|
||||||
|
rm -rf certs/$2.crt
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $(uname -n) = "sayaka" -o $(uname -n) = "kimari" ]; then
|
if [ $(uname -n) = "sayaka" -o $(uname -n) = "kimari" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue