From 845f0f5d9493fd88152e104bb7ab726d08e336c8 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 23 Nov 2024 09:54:49 +0700 Subject: [PATCH] Move timestamp to last --- sudoutil.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sudoutil.js b/sudoutil.js index e4e4f15..abbd771 100755 --- a/sudoutil.js +++ b/sudoutil.js @@ -339,9 +339,9 @@ switch (cli.args.shift()) { if (statutes.some((s) => s !== 'active')) exitcode = 1; ShellString(JSON.stringify({ - timestamp: Date.now(), status: exitcode === 0 ? 'OK' : 'ERROR', - statuses: Object.fromEntries(services.map((k, i) => [k, statutes[i]])) + statuses: Object.fromEntries(services.map((k, i) => [k, statutes[i]])), + timestamp: Date.now(), })).to(env.SHELLCHECK_TMP); exit(0); case 'SHELL_TEST': @@ -388,7 +388,6 @@ switch (cli.args.shift()) { fpms.some((f) => f.code !== 0) || storagefull || !quotaOK) exitcode = 1; ShellString(JSON.stringify({ - timestamp: Date.now(), status: exitcode === 0 ? 'OK' : 'ERROR', codes: { nginx: nginx.code, @@ -408,6 +407,7 @@ switch (cli.args.shift()) { iptables: iptables.stderr.trimEnd().split('\n'), ip6tables: ip6tables.stderr.trimEnd().split('\n'), }, + timestamp: Date.now(), })).to(env.SHELLTEST_TMP); exit(0); default: