Command Line switch to force answer to "Update"?

Issued the command below, and was prompted to (U)update cert or (C)confirm - can anyone point me to a command line switch that automatically answers this question? Needed for an automated sequence.

/usr/bin/certbot certonly --webroot --webroot-path /var/www/http02/ --expand --cert-name --domain
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None

You are updating certificate to include new domain(s):

You are also removing previously included domain(s):

Did you intend to make this change?

(U)pdate cert/(C)cancel:

There's a -n (noninteractive) flag

I'm not sure exactly what it'll do in this scenario

Try it with a --dry-run and see what it does

there's also an --expand which should automatically accept certificate expansion (the domain you're adding) but I don't see one for certificate contraction (the domain you're removing)

try -n --expand --dry-run and see where that gets you


Brilliant - that did the trick - not sure how I missed the "-n" in the documentation. May need additional coffee today :slight_smile:

1 Like