Advertisement
Guest User

Untitled

a guest
Jun 19th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.61 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # set ACPI Wakeup time
  4. # usage: setwakeup.sh seconds
  5. #    seconds - number of seconds from epoch to UTC time (time_t time format)
  6. #
  7. # set UTCBIOS to true if bios is using UTC time
  8. # set UTCBIOS to false if bios is using local time
  9.  
  10. UTCBIOS=true
  11.  
  12. if $UTCBIOS
  13. then
  14.     #utc bios - use supplied seconds
  15.     SECS=$1
  16. else
  17.     #non utc bios - convert supplied seconds to seconds from
  18.     #epoch to local time
  19.     SECS=`date -u --date "\`date --date @$1 +%F" "%T\`" +%s`
  20. fi
  21.  
  22. echo 0 > /sys/class/rtc/rtc0/wakealarm       # clear alarm
  23. echo $SECS > /sys/class/rtc/rtc0/wakealarm   # write the waketime
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement