<!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. 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> </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> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=636394918-18072007>-----------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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> </DIV>
<DIV><FONT face=Arial size=2> PARAMERROR=<BR> <BR> if [ $# -lt
2 ] ; then<BR> PARAMERROR="Too few parameters."<BR> elif
[ $# -gt 3 ] ; then<BR> PARAMERROR="Too many
parameters."<BR> else<BR> if [ $# -eq 2 ] ;
then<BR>
PFLAG=$1<BR>
PEPOCH=$2<BR> PVERBOSE=""<BR>
else<BR>
PFLAG=$2<BR>
PEPOCH=$3<BR> PVERBOSE=$1<BR>
fi</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> NOW_EPOCH=$(date
"+%s")<BR> if [ $NOW_EPOCH -gt $PEPOCH ] ;
then<BR> PARAMERROR="Passed time (in epoch format)
has already passed."<BR>
else<BR> #For testing, next line sets input time
to July 18 2007, 4:39pm<BR>
#PEPOCH="1184791140"<BR> NEW_TIME=$(date -d
"1970-01-01 ${PEPOCH} sec GMT" "+%Y-%m-%d %H:%M:%S")<BR>
fi</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> if [ -z "$PARAMERROR" ] ;
then<BR> if [ $PFLAG != "--settime" ] ;
then<BR> PARAMERROR="Invalid parameter
format."<BR> else<BR>
<BR> if [ "$PVERBOSE" = "-v" ] ;
then<BR> echo "acpi-wakup
version 0.1"<BR> echo
" Time passed in epoch format:
[$PEPOCH]"<BR> echo
" Computed wakeup time:
[$NEW_TIME]"<BR> elif [ -n "$PVERBOSE"
] ; then<BR>
PARAMERROR="Unexpected final parameter
encountered."<BR>
fi<BR> fi<BR> fi<BR>
fi<BR> <BR> if [ -n "$PARAMERROR" ] ; then<BR>
echo "acpi-wake version 0.1"<BR> echo ""<BR>
echo " Error: $PARAMERROR"<BR> echo
""<BR> echo " Usage: acpi-wakeup [ -v ] --settime
XXXXXXXX"<BR> echo ""<BR> else<BR>
echo "$NEW_TIME" > /proc/acpi/alarm<BR> if [ "$PVERBOSE" =
"-v" ] ; then<BR> echo " Confirmed ACPI
wakeup alarm:"$(cat /proc/acpi/alarm)<BR> fi<BR>
fi</FONT></DIV></BODY></HTML>