LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Rate this Entry

Script to quickly set the wake-alarm power on

Posted 04-27-2014 at 11:40 PM by the dsc
Updated 04-27-2014 at 11:43 PM by the dsc
Tags wakealarm

I think it's working. Issuing "set-alarm 6:00" will set the computer to automatically turn on the next day at 6am, or the same day, if the script was executed after midnight already.


Information about the whole thing, read before trying anything, no warranties/responsibilities whatsoever and all that, actually by having some trouble with the script you warrant ME the legal rights to sue YOU for a billion dollars and/or have you as my free butler for life:

http://www.mythtv.org/wiki/ACPI_Wakeup


Code:
#!/bin/bash

echo 0 > /sys/class/rtc/rtc0/wakealarm

hour=`date '+%H'` ; hour="$(echo $hour | sed 's:0*::')" 

if [ $hour -ge 0 ] && [ $hour -lt 12 ]; then pref="today"
else
pref="tomorrow"
fi


date -u --date="$pref $1" +%s > /sys/class/rtc/rtc0/wakealarm

grep "alrm_date\|alrm_t\|m_IRQ" /proc/driver/rtc
Posted in Uncategorized
Views 1291 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 02:15 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration