Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Save all of this in a file named wakeup_test.sh (or any name you like)
- # Make the file executable: chmod a+x wakeup_test.sh
- # Run the file with: sudo ./wakeup_test.sh
- # Shutdown the system with: sudo shutdown -h now
- # Expect wakeup in 60 seconds.
- ALARM_FILE="/sys/class/rtc/rtc0/wakealarm"
- ALARM_STAT="/proc/driver/rtc"
- WAKEUP_TIME=$((`date +'%s'` + 60))
- echo 0 > ${ALARM_FILE}
- RC=$?
- if [ ${?} -ne 0 ]; then
- echo "ERROR: Can't write to ${ALARM_FILE}, RC = ${RC}"
- exit 2
- fi
- echo ${WAKEUP_TIME} > ${ALARM_FILE}
- cat ${ALARM_STAT}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement