Advertisement
Guest User

Untitled

a guest
Feb 15th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 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. LOG=/var/log/mythtv/mythbackend.log
  12.  
  13. if $UTCBIOS
  14. then
  15.     #utc bios - use supplied seconds
  16.     SECS=$1
  17. else
  18.     #non utc bios - convert supplied seconds to seconds from
  19.     #epoch to local time
  20.     SECS=`date -u --date "\`date --date @$1 +%F" "%T\`" +%s`
  21. fi
  22.  
  23. echo "Passed time: $1" >> $LOG
  24. echo "Running $0 to set the wakeup time to $SECS" >> $LOG
  25.  
  26. echo 0 > /sys/class/rtc/rtc0/wakealarm    # clear alarm
  27. echo $SECS > /sys/class/rtc/rtc0/wakealarm   # write the waketime
  28.  
  29. cat /proc/driver/rtc >> $LOG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement