fallback to no rtcwake in case of missing mnc rather than having a broken crust

Though we'll ship and install mnc by default, we already someone run
into this, so best make the script a bit more robust.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
master
Maarten van Gompel 3 years ago committed by Stacy Harper
parent 09fcfa9894
commit 0d528ff878
No known key found for this signature in database
GPG Key ID: 5BAC92328B7C5D65
  1. 7
      scripts/core/sxmo_screenlock.sh

@ -151,10 +151,13 @@ elif [ "$1" = "crust" ] ; then
#turn screen off
xset dpms force off
suspend_time="$(($(mnc)-10))"
YEARS8_TO_SEC=268435455
if [ "$suspend_time" -gt "$YEARS8_TO_SEC" ]; then
if command -v mnc > /dev/null; then
#wake up 10 seconds before the next cron event
suspend_time="$(($(mnc)-10))"
fi
if [ -z "$suspend_time" ] || [ "$suspend_time" -gt "$YEARS8_TO_SEC" ]; then
suspend_time="$YEARS8_TO_SEC"
fi
if [ "$suspend_time" -gt 0 ]; then

Loading…
Cancel
Save