summaryrefslogtreecommitdiffstats
path: root/roles/common/files/usr/local/bin/gendhparam.sh
blob: 84b7d56a2f7facf0db7322f9fa45aee360ab197d (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

set -ue
PATH=/usr/bin:/bin

privkey="$1"
bits="${2:-2048}"
rand=

install --mode=0600 /dev/null "$privkey"
openssl dhparam -rand "${rand:-/dev/urandom}" "$bits" >"$privkey"