18 lines
496 B
Bash
18 lines
496 B
Bash
#!/bin/sh
|
|||
|
|
|
||
|
|
# Certbot entrypoint script
|
||
|
|
# Se vengono passati argomenti, esegui il comando direttamente
|
||
|
|
# Altrimenti, esegui il loop di auto-renewal
|
||
|
|
|
||
|
|
if [ $# -eq 0 ]; then
|
||
|
|
# Nessun argomento: modalità auto-renewal
|
||
|
|
echo "Starting certbot auto-renewal service..."
|
||
|
|
trap exit TERM
|
||
|
|
while :; do
|
||
|
|
certbot renew --webroot --webroot-path=/var/www/certbot --quiet
|
||
|
|
sleep 12h & wait ${!}
|
||
|
|
done
|
||
|
|
else
|
||
|
|
# Argomenti passati: esegui il comando certbot
|
||
|
|
exec certbot "$@"
|
||
|
|
fi
|