#!/bin/sh
# postinst script for nginx-snippets.

set -e

# Generate the /etc/nginx/dhparam2048.pem if the file doesn't 
# already exist.
if [ ! -e /etc/nginx/dhparam2048.pem ]; then
  echo "Generating dhparam with 2048 bits. This may take some time."
  openssl dhparam -out /etc/nginx/dhparam2048.pem 2048
  echo "Generated dhparam file with 2048 bits in /etc/nginx/dhparam2048.pem"
else
  echo "dhparam2048.pem file already exists."
fi

#DEBHELPER#

exit 0
