From: Vsevolod Stakhov Date: Sun, 4 Nov 2018 10:52:49 +0000 (+0000) Subject: [Minor] Allow to print timestamp X-Git-Tag: 1.8.2~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1473bfa1efef8b4117bc48e4b0b24c10b8846619;p=thirdparty%2Frspamd.git [Minor] Allow to print timestamp --- diff --git a/lualib/rspamadm/cookie.lua b/lualib/rspamadm/cookie.lua index d6db58a634..b9995cdf9f 100644 --- a/lualib/rspamadm/cookie.lua +++ b/lualib/rspamadm/cookie.lua @@ -36,6 +36,8 @@ parser:option "-d --domain" :argname "" parser:flag "-D --decrypt" :description('Decrypt cookie instead of encrypting one') +parser:flag "-t --timestamp" + :description('Show cookie timestamp (valid for decrypting only)') parser:argument "cookie":args "?" :description('Use specified cookie') @@ -65,10 +67,14 @@ local function gen_cookie(args, key) extracted_cookie = args.cookie end - local dec_cookie = cr.decrypt_cookie(key, extracted_cookie) + local dec_cookie,ts = cr.decrypt_cookie(key, extracted_cookie) if dec_cookie then - print(dec_cookie) + if args.timestamp then + print(string.format('%s %s', dec_cookie, ts)) + else + print(dec_cookie) + end else print('cannot decrypt cookie') os.exit(1)