#!/bin/bash
# verwijderd certificaat van site

if [ -z "$1" ] ; then
        echo "usage: cert domain e.g. example.nl or test.example.nl"
        exit
fi

rm -r /etc/letsencrypt/archive/$1 >/dev/null 2>&1
rm -r /etc/letsencrypt/live/$1 >/dev/null 2>&1
rm -r /etc/letsencrypt/renewal/$1.conf >/dev/null 2>&1

# SSL config weghalen uit Apache:
rm /etc/apache2/sites-available/$1-le-ssl.conf >/dev/null 2>&1
rm /etc/apache2/sites-enabled/$1-le-ssl.conf >/dev/null 2>&1
systemctl reload apache2
