Skip to content

Commit fcaa8cd

Browse files
committed
refact+fix: dialogs and hostname
1 parent 01987eb commit fcaa8cd

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎system/cuos/dialog-reports.sh‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,31 @@ change_vt
1515
trap cleanup EXIT
1616

1717
tmpfile=$(mktemp)
18+
cat <<EOF >"$tmpfile"
19+
20+
Host: $(hostname)
21+
22+
Start Time: $(jq -r '.start_date | sub("T"; " ") | sub("Z"; " UTC")' /data/state.json)
23+
Last Update: $(jq -r '.last_update_date | sub("T"; " ") | sub("Z"; " UTC")' /data/state.json)
24+
25+
EOF
1826

1927
journalctl \
2028
--identifier=cuos \
2129
--merge \
2230
--follow \
23-
--lines=20 \
31+
--lines=15 \
2432
--boot=all \
2533
--no-pager \
2634
--output=json | jq --unbuffered -r '
2735
. as $e |
2836
(if ($e.MESSAGE | test("^cuos:init:start")) then "\n" else "" end) +
2937
(($e.__REALTIME_TIMESTAMP | tonumber) / 1000000 | strflocaltime("%Y-%m-%d %H:%M:%S")) +
3038
" " +
31-
(["[emerg]","[alert]","[crit] ","[err] ","[warning]","[notice]","[info] ","[debug]"][$e.PRIORITY | tonumber]) +
39+
(["[emerg] ","[alert] ","[crit] ","[err] ","[warning]","[notice]","[info] ","[debug] "][$e.PRIORITY | tonumber]) +
3240
" " +
33-
$e.MESSAGE
34-
' > "$tmpfile" &
41+
$e.MESSAGE | sub("^cuos:[a-z:_-]+ "; "")
42+
' >> "$tmpfile" &
3543
JOURNAL_PID=$!
3644

3745
term cuos_dialog \

0 commit comments

Comments
 (0)