Advertisement
Guest User

Wakeup Test Script

a guest
Aug 30th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Save all of this in a file named wakeup_test.sh (or any name you like)
  4. # Make the file executable: chmod a+x wakeup_test.sh
  5. # Run the file with: sudo ./wakeup_test.sh
  6. # Shutdown the system with: sudo shutdown -h now
  7. # Expect wakeup in 60 seconds.
  8.  
  9. ALARM_FILE="/sys/class/rtc/rtc0/wakealarm"
  10. ALARM_STAT="/proc/driver/rtc"
  11.  
  12. WAKEUP_TIME=$((`date +'%s'` + 60))
  13.  
  14. echo 0 > ${ALARM_FILE}
  15. RC=$?
  16. if [ ${?} -ne 0 ]; then
  17. echo "ERROR: Can't write to ${ALARM_FILE}, RC = ${RC}"
  18. exit 2
  19. fi
  20. echo ${WAKEUP_TIME} > ${ALARM_FILE}
  21. cat ${ALARM_STAT}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement