main: return code increments on number of alerted certs
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
82905131cc
commit
3bdddaa253
1 changed files with 3 additions and 0 deletions
3
main.go
3
main.go
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
var retCode int = 0
|
||||||
fDays := flag.Int("d", 20, "number of days to alert on")
|
fDays := flag.Int("d", 20, "number of days to alert on")
|
||||||
fDebug := flag.Bool("D", false, "debug mode")
|
fDebug := flag.Bool("D", false, "debug mode")
|
||||||
|
|
||||||
|
@ -60,6 +61,7 @@ func main() {
|
||||||
log.Warnf("%q : TIME TO RENEW CERTIFICATE (expires in less than %d days)", file, *fDays)
|
log.Warnf("%q : TIME TO RENEW CERTIFICATE (expires in less than %d days)", file, *fDays)
|
||||||
log.Infof("%q : %v", file, cert.NotAfter)
|
log.Infof("%q : %v", file, cert.NotAfter)
|
||||||
log.Infof("%q : %v", file, cert.DNSNames)
|
log.Infof("%q : %v", file, cert.DNSNames)
|
||||||
|
retCode += 1
|
||||||
} else {
|
} else {
|
||||||
log.Debugf("%q : %v", file, cert.NotAfter)
|
log.Debugf("%q : %v", file, cert.NotAfter)
|
||||||
log.Debugf("%q : %v", file, cert.DNSNames)
|
log.Debugf("%q : %v", file, cert.DNSNames)
|
||||||
|
@ -67,4 +69,5 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os.Exit(retCode)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue