# HG changeset patch # User Kim Alvefur # Date 1364566560 -3600 # Node ID a8203db13ca25992f29037362ec7e29d2369d1fd # Parent 4fdcb5c350218525d1d500f48df0414d9704fcdc mod_checkcerts: Modify wording a bit. diff -r 4fdcb5c35021 -r a8203db13ca2 mod_checkcerts/mod_checkcerts.lua --- a/mod_checkcerts/mod_checkcerts.lua Thu Mar 28 08:22:06 2013 +0100 +++ b/mod_checkcerts/mod_checkcerts.lua Fri Mar 29 15:16:00 2013 +0100 @@ -41,18 +41,19 @@ -- This might be wrong if the certificate has NotBefore in the future. -- However this is unlikely to happen with CA-issued certs in the wild. + local notafter = cert.notafter and cert:notafter(); if not valid_at(cert, now) then module:log("error", "The certificate %s has expired", certfile); module:send(st.message({from=module.host,to=admin,type="chat"},("Certificate for host %s has expired!"):format(module.host))); elseif not valid_at(cert, now+86400*7) then - module:log("warn", "The certificate %s will expire this week", certfile); + module:log("warn", "The certificate %s will expire %s", certfile, notafter or "this week"); for _,admin in ipairs(module:get_option_array("admins", {})) do - module:send(st.message({from=module.host,to=admin,type="chat"},("Certificate for host %s is about to expire!"):format(module.host))); + module:send(st.message({from=module.host,to=admin,type="chat"},("Certificate for host %s will expire %s!"):format(module.host, notafter or "this week"))); end elseif not valid_at(cert, now+86400*30) then module:log("warn", "The certificate %s will expire later this month", certfile); else - module:log("info", "The certificate %s is valid until %s", certfile, cert.notafter and cert:notafter() or "later"); + module:log("info", "The certificate %s is valid until %s", certfile, notafter or "later"); end end end