mirror of
https://github.com/go-acme/lego.git
synced 2025-09-16 09:36:23 +02:00
CLI: renew only the first domain (CommonName)
This commit is contained in:
@@ -173,7 +173,12 @@ func revoke(c *cli.Context) {
|
|||||||
func renew(c *cli.Context) {
|
func renew(c *cli.Context) {
|
||||||
conf, _, client := setup(c)
|
conf, _, client := setup(c)
|
||||||
|
|
||||||
for _, domain := range c.GlobalStringSlice("domains") {
|
if len(c.GlobalStringSlice("domains")) <= 0 {
|
||||||
|
logger().Fatal("Please specify at least one domain.")
|
||||||
|
}
|
||||||
|
|
||||||
|
domain := c.GlobalStringSlice("domains")[0]
|
||||||
|
|
||||||
// load the cert resource from files.
|
// load the cert resource from files.
|
||||||
// We store the certificate, private key and metadata in different files
|
// We store the certificate, private key and metadata in different files
|
||||||
// as web servers would not be able to work with a combined file.
|
// as web servers would not be able to work with a combined file.
|
||||||
@@ -192,8 +197,8 @@ func renew(c *cli.Context) {
|
|||||||
logger().Printf("Could not get Certification expiration for domain %s", domain)
|
logger().Printf("Could not get Certification expiration for domain %s", domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
if int(expTime.Sub(time.Now()).Hours()/24.0) <= c.Int("days") {
|
if int(expTime.Sub(time.Now()).Hours() / 24.0) <= c.Int("days") {
|
||||||
continue
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,5 +227,4 @@ func renew(c *cli.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveCertRes(newCert, conf)
|
saveCertRes(newCert, conf)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user