From 11f2777e0f235fb00605ce27f766309048ec91ec Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Tue, 6 Jul 2021 09:28:46 +0200 Subject: [PATCH] Fix rtcwake when there is no cronjob rtcwake can't take the default value of mnc when there is no cron job cause it is too big. We limit this value to 8 years, a working value. Signed-off-by: Stacy Harper Signed-off-by: Anjandev Momi --- scripts/core/sxmo_screenlock.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/core/sxmo_screenlock.sh b/scripts/core/sxmo_screenlock.sh index 4daec43..f02b9fc 100755 --- a/scripts/core/sxmo_screenlock.sh +++ b/scripts/core/sxmo_screenlock.sh @@ -131,6 +131,9 @@ elif [ "$1" = "crust" ] ; then xset dpms force off suspend_time="$(($(mnc)-10))" + if [ "$suspend_time" -gt 268435455 ]; then + suspend_time=268435455 + fi if [ "$suspend_time" -gt 0 ]; then rtcwake -m mem -s "$suspend_time" UNSUSPENDREASON=$(whichWake)