#!/bin/bash # # Licensed under GPL v3 or higher # kill -9 $(cat /var/run/rngd.pid) 2> /dev/null || true r=$[ ( $RANDOM % 10 ) + 1 ] rngd -r /dev/urandom -t $r echo $r [ -d /etc/ldap/ssl ] || mkdir -p /etc/ldap/ssl || true openssl req -new -newkey rsa:4096 -days 0 -nodes -x509 -subj "/C=ES/ST=VALENCIA/L=LliureX/O=server/CN=$(hostname)" -keyout /etc/ldap/ssl/slapd.key -out /etc/ldap/ssl/slapd.cert kill -9 $(cat /var/run/rngd.pid)