diff --git a/main.go b/main.go index 76edb4f..be879e4 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( ) func main() { + var retCode int = 0 fDays := flag.Int("d", 20, "number of days to alert on") 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.Infof("%q : %v", file, cert.NotAfter) log.Infof("%q : %v", file, cert.DNSNames) + retCode += 1 } else { log.Debugf("%q : %v", file, cert.NotAfter) log.Debugf("%q : %v", file, cert.DNSNames) @@ -67,4 +69,5 @@ func main() { } } + os.Exit(retCode) }