From f0b6c2798b99d1b382ec8ec44b8f3ff572babd35 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 23 Feb 2010 13:52:20 +0200 Subject: logfile --- poweron.command | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 poweron.command diff --git a/poweron.command b/poweron.command new file mode 100644 index 0000000..be844e1 --- /dev/null +++ b/poweron.command @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +ON_DELAY=20 +OFF_DELAY=20 +LOGFILE=~/Desktop/powereon.command.log + +if [[ $USER != "root" ]]; then + echo "This must be run as root" + exit 1 +fi + +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 +shutdown -h now -- cgit v1.2.3