From 0d3869bbb5c53cd4e3d216b3aaa791473db8e5a8 Mon Sep 17 00:00:00 2001 From: qoijjj <129108030+qoijjj@users.noreply.github.com> Date: Sun, 18 Aug 2024 21:35:05 -0700 Subject: [PATCH] fix: use json format for rpm-ostree in motd --- files/system/usr/libexec/ublue-motd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/system/usr/libexec/ublue-motd b/files/system/usr/libexec/ublue-motd index 646b08f..7da83df 100755 --- a/files/system/usr/libexec/ublue-motd +++ b/files/system/usr/libexec/ublue-motd @@ -7,7 +7,7 @@ IMAGE_REF_NAME=$(echo $RPM_OSTREE_STATUS | jq -r '.deployments[0]."container-ima IMAGE_TAG=$(echo $RPM_OSTREE_STATUS | jq -r '.deployments[0]."container-image-reference" // empty | split(":")[-1]') TIP="" -IMAGE_DATE=$(rpm-ostree status --booted | sed -n 's/.*Timestamp: \(.*\)/\1/p') +IMAGE_DATE=$(rpm-ostree status --json --booted | sed -n 's/.*Timestamp: \(.*\)/\1/p') IMAGE_DATE_SECONDS=$(date -d "$IMAGE_DATE" +%s) CURRENT_SECONDS=$(date +%s) DIFFERENCE=$((CURRENT_SECONDS - IMAGE_DATE_SECONDS))