问题原文
原帖链接 · user25282 · CC BY-SA 4.0
I have a script which daily runs the command
certbot --nginx -d $DOMAIN
for a number of domains to renew their certificate
You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/****.conf)
What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): Cert not yet due for renewal
I always pick 1 if the certificate is not close to expiry. Is there a flag I can pass to the command to make it always pick 1?
已采纳解答
原帖链接 · Gerald Schneider · CC BY-SA 4.0
You can try running the command with the -n parameter:
Run without ever asking for user input. This may
require additional command line flags; the client will
try to explain which ones are required if it finds one
missing
If that doesn't help you can use the common methods to answer questions of command line tools:
Piping the answer into the command
echo "1" | certbot [...]use
expectUse other means to edit the config file, e.g.
sedor a configuration management solution of your choice.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
