大网数据广告活动
服务器运维问答

Is there a command line flag for "Attempt to reinstall this existing certificate" in certbot-nginx?

· 52CE 我爱测

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 i…

问题原文

原帖链接 · 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:

  1. Piping the answer into the command

    echo "1" | certbot [...]
    
  2. use expect

  3. Use other means to edit the config file, e.g. sed or a configuration management solution of your choice.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-08-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。