fix merge bug in systemd
This commit is contained in:
parent
78f6d93804
commit
0c414738e1
2 changed files with 20 additions and 19 deletions
16
mail-server/script/create_certificate
Normal file
16
mail-server/script/create_certificate
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Create certificates if they do not exist yet
|
||||
dir="${cfg.certificateDirectory}"
|
||||
fqdn="${cfg.hostPrefix}.${cfg.domain}"
|
||||
case $fqdn in /*) fqdn=$(cat "$fqdn");; esac
|
||||
key="''${dir}/key-${cfg.domain}.pem";
|
||||
cert="''${dir}/cert-${cfg.domain}.pem";
|
||||
|
||||
if [ ! -f "''${key}" ] || [ ! -f "''${cert}" ]
|
||||
then
|
||||
mkdir -p "${cfg.certificateDirectory}"
|
||||
(umask 077; "${pkgs.openssl}/bin/openssl" genrsa -out "''${key}" 2048) &&
|
||||
"${pkgs.openssl}/bin/openssl" req -new -key "''${key}" -x509 -subj "/CN=''${fqdn}" \
|
||||
-days 3650 -out "''${cert}"
|
||||
fi
|
||||
|
||||
# vim: set filetype=sh
|
Loading…
Add table
Add a link
Reference in a new issue