<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=636394918-18072007>After some 
struggling, and realizing that my motherboard wouldn't work with nvram-wakeup, I 
wrote a simple bash script to set the wakeup time using the /proc ACPI 
interface.&nbsp; The script called "acpi-wakeup" is below, and is parameter 
compatible with nvram-wakeup.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=636394918-18072007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=636394918-18072007>Cheers,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=636394918-18072007>Md</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=636394918-18072007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=636394918-18072007>-----------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#!/bin/bash<BR># Set the wakeup time using proc 
ACPI interface, instead of writing to NVRAM<BR># By Michelle DUpuis<BR># <A 
href="mailto:support@ocg.ca">support@ocg.ca</A><BR># Version 0.1</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; PARAMERROR=<BR>&nbsp; <BR>&nbsp; if [ $# -lt 
2 ] ; then<BR>&nbsp;&nbsp;&nbsp; PARAMERROR="Too few parameters."<BR>&nbsp; elif 
[ $# -gt 3 ] ; then<BR>&nbsp;&nbsp;&nbsp; PARAMERROR="Too many 
parameters."<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; if [ $# -eq 2 ] ; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PFLAG=$1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PEPOCH=$2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PVERBOSE=""<BR>&nbsp;&nbsp;&nbsp; 
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PFLAG=$2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PEPOCH=$3<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PVERBOSE=$1<BR>&nbsp;&nbsp;&nbsp; 
fi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; NOW_EPOCH=$(date 
"+%s")<BR>&nbsp;&nbsp;&nbsp; if [ $NOW_EPOCH -gt $PEPOCH ] ; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PARAMERROR="Passed time (in epoch format) 
has already passed."<BR>&nbsp;&nbsp;&nbsp; 
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #For testing, next line sets input time 
to July 18 2007, 4:39pm<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
#PEPOCH="1184791140"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NEW_TIME=$(date -d 
"1970-01-01 ${PEPOCH} sec GMT" "+%Y-%m-%d %H:%M:%S")<BR>&nbsp;&nbsp;&nbsp; 
fi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; if [ -z "$PARAMERROR" ] ; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $PFLAG != "--settime" ] ; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PARAMERROR="Invalid parameter 
format."<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ "$PVERBOSE" = "-v" ] ; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "acpi-wakup 
version 0.1"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 
"&nbsp; Time passed in epoch format: 
[$PEPOCH]"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 
"&nbsp; Computed wakeup time: 
[$NEW_TIME]"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elif [ -n "$PVERBOSE" 
] ; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PARAMERROR="Unexpected final parameter 
encountered."<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<BR>&nbsp;&nbsp;&nbsp; fi<BR>&nbsp; 
fi<BR>&nbsp; <BR>&nbsp; if [ -n "$PARAMERROR" ] ; then<BR>&nbsp;&nbsp;&nbsp; 
echo "acpi-wake version 0.1"<BR>&nbsp;&nbsp;&nbsp; echo ""<BR>&nbsp;&nbsp;&nbsp; 
echo "&nbsp; Error: $PARAMERROR"<BR>&nbsp;&nbsp;&nbsp; echo 
""<BR>&nbsp;&nbsp;&nbsp; echo "&nbsp; Usage: acpi-wakeup [ -v ] --settime 
XXXXXXXX"<BR>&nbsp;&nbsp;&nbsp; echo ""<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; 
echo "$NEW_TIME" &gt; /proc/acpi/alarm<BR>&nbsp;&nbsp;&nbsp; if [ "$PVERBOSE" = 
"-v" ] ; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "&nbsp; Confirmed ACPI 
wakeup alarm:"$(cat /proc/acpi/alarm)<BR>&nbsp;&nbsp;&nbsp; fi<BR>&nbsp; 
fi</FONT></DIV></BODY></HTML>