View Single Post
Old 09-06-2019, 04:15 AM   #39
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 446
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Here's a simple script to check if the alarm system works:
Code:
#! /bin/sh

set -e
WAKE_ALARM=/sys/class/rtc/rtc0/wakealarm
# Cancel an existing alarm.
echo 0 > "$WAKE_ALARM"
# Set an alarm one second into the future.
echo +1 > "$WAKE_ALARM"
# Check that the pseudo-file contains a Unix Epoch.
grep -q '^[0-9]\+$' "$WAKE_ALARM"
# The alarm should fire while we're sleeping.
sleep 2
# And now, the pseudo-file should be empty.
test -s "$WAKE_ALARM"
baskerville is offline   Reply With Quote