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>
This commit is contained in:
parent
09fcfa9894
commit
0d528ff878
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue