From 5ee24f53b7b017417cf386fb0158175dcb0b1a0e Mon Sep 17 00:00:00 2001 From: Burathar Date: Sat, 6 Feb 2021 19:58:18 +0100 Subject: [PATCH] Fix sec. since wakeup script: Didn't work when day of month < 10 --- bin/seconds_since_wakeup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/seconds_since_wakeup.sh b/bin/seconds_since_wakeup.sh index c5f4762..f2d2ab0 100755 --- a/bin/seconds_since_wakeup.sh +++ b/bin/seconds_since_wakeup.sh @@ -1,6 +1,6 @@ #! /bin/bash -last_wakeup_str=`grep "Enabling non-boot CPUs ..." /var/log/kern.log | tail -n 1 | cut -d ' ' -f 1-3` +last_wakeup_str=`grep "Enabling non-boot CPUs ..." /var/log/kern.log | tail -n 1 | egrep -o '^.*..:..:..' | head -1` [ -z "$last_wakeup_str" ] && echo -1 && exit 1 wakeup_unix="$(date --date="$last_wakeup_str" +%s)"