magic number: make 8 years in seconds a constant

This commit is contained in:
Anjandev Momi 2021-07-06 22:13:24 -04:00
parent 11f2777e0f
commit 23acd8a8c2

View file

@ -131,8 +131,10 @@ elif [ "$1" = "crust" ] ; then
xset dpms force off
suspend_time="$(($(mnc)-10))"
if [ "$suspend_time" -gt 268435455 ]; then
suspend_time=268435455
YEARS8_TO_SEC=268435455
if [ "$suspend_time" -gt "$YEARS8_TO_SEC" ]; then
suspend_time="$YEARS8_TO_SEC"
fi
if [ "$suspend_time" -gt 0 ]; then
rtcwake -m mem -s "$suspend_time"