#!/bin/sh prefix="@prefix@" exec_prefix="@exec_prefix@" sysconfdir="@sysconfdir@" echo "Generating private key and CSR... " openssl req -new -newkey rsa:4096 -nodes -sha512 -out "${sysconfdir}"/ssl.csr -keyout "${sysconfdir}"/ssl.key echo "Self-signing certificate..." openssl x509 -req -sha512 -days 365 -in "${sysconfdir}"/ssl.csr -signkey "${sysconfdir}"/ssl.key -out "${sysconfdir}"/ssl.pem echo "Generating Diffie-Hellman file for secure SSL/TLS negotiation .. " openssl dhparam -out "${sysconfdir}"/dh.pem 2048 # If sysconfdir is relative to prefix, make the path relative. I.e., # prefix=/usr and sysconfdir=/etc -> relative_sysconfdir=/etc, # prefix=/home/binki/chary and sysconfdir=/home/binki/chary/etc -> # relative_sysconfdir=etc relative_sysconfdir="${sysconfdir#${prefix%/}/}" relative_sysconfdir="${relative_sysconfdir%/}" cat <