#!/bin/bash

if [ -z "$1" ]
then
    echo "Give the (domain)name of the certificates, e.g. 'www.example.nl'"
    exit
fi

cd /etc/ssl/private/new

rm $1.crt
pico $1.crt

cat $1.crt > $1.pem
cat /etc/ssl/private/RapidSSL_SHA256_CA_-_G3.crt >> $1.pem
cat $1.key >> $1.pem

# rechten goed zetten
chown root:ssl-cert $1.*

# .csr bestand kan gewist worden

cp -a $1.pem /etc/ssl/private/
# /etc/init.d/apache2 reload

echo klaar, doe nu /etc/init.d/apache2 reload
echo test het resultaat op https://www.sslcertificaten.nl/SSLCheck?domain=$1

