From 11076e677163dc974db3b4d9aa1ee67e23c760d1 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 23 Feb 2010 14:06:27 +0200 Subject: Tuned delays --- poweron.command | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) mode change 100644 => 100755 poweron.command diff --git a/poweron.command b/poweron.command old mode 100644 new mode 100755 index be844e1..5dae15c --- a/poweron.command +++ b/poweron.command @@ -2,16 +2,17 @@ ON_DELAY=20 OFF_DELAY=20 -LOGFILE=~/Desktop/powereon.command.log +LOGFILE=~/Desktop/poweron.command.log if [[ $USER != "root" ]]; then - echo "This must be run as root" - exit 1 + echo "This must be run as root" + exit 1 fi -sleep $ON_DELAY -TIMESTAMP=$(php -r "echo @date('H:i:s', time() + ${OFF_DELAY});") +sleep ${ON_DELAY} + +TIMESTAMP=$(php -r "echo @date('H:i:s', time() + $OFF_DELAY);") pmset repeat poweron MTWRFSU ${TIMESTAMP} -echo -n $(date "+%d.%m.%y @ %H:%I:%S") >> $LOGFILE -echo " " $(wc -l $LOGFILE) >> $LOGFILE +echo -n $(date "+%d.%m.%y @ %H:%I:%S") >> ${LOGFILE} +echo " " $(wc -l $LOGFILE) >> ${LOGFILE} shutdown -h now -- cgit v1.2.3