aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2010-02-23 13:52:20 +0200
committerFilipp Lepalaan <filipp@mac.com>2010-02-23 13:52:20 +0200
commitf0b6c2798b99d1b382ec8ec44b8f3ff572babd35 (patch)
treeea75992115a226da40f083024fe20275518addbf
parent041af8c2c23637f080c286a4baf60494188a2819 (diff)
downloadmtk-f0b6c2798b99d1b382ec8ec44b8f3ff572babd35.tar.gz
mtk-f0b6c2798b99d1b382ec8ec44b8f3ff572babd35.tar.bz2
mtk-f0b6c2798b99d1b382ec8ec44b8f3ff572babd35.zip
logfile
-rw-r--r--poweron.command17
1 files changed, 17 insertions, 0 deletions
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