18 lines
356 B
Bash
Executable File
18 lines
356 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Vérifie qu'un domaine a été passé en argument
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 domaine.com"
|
|
exit 1
|
|
fi
|
|
|
|
DOMAIN="$1"
|
|
|
|
# Exécution de certbot
|
|
certbot certonly --standalone -d "$DOMAIN"
|
|
|
|
|
|
cat /etc/letsencrypt/live/"$DOMAIN"/privkey.pem \
|
|
/etc/letsencrypt/live/"$DOMAIN"/fullchain.pem \
|
|
> /home/certificate/"$DOMAIN".pem
|