Skip to content

Commit

Permalink
Move timestamp to last
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Nov 23, 2024
1 parent 0b95426 commit 845f0f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sudoutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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,
Expand All @@ -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:
Expand Down

0 comments on commit 845f0f5

Please sign in to comment.