aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2010-02-23 13:07:58 +0200
committerFilipp Lepalaan <filipp@mac.com>2010-02-23 13:07:58 +0200
commit71eece2a8c8d37f2782f2a0ec3426b8ac1e4bc46 (patch)
tree30ede541501c1eb9a06470d7a593287753bfda4c
parent5a6777379c6da389df145aca6c679f8eeabd2108 (diff)
downloadmtk-71eece2a8c8d37f2782f2a0ec3426b8ac1e4bc46.tar.gz
mtk-71eece2a8c8d37f2782f2a0ec3426b8ac1e4bc46.tar.bz2
mtk-71eece2a8c8d37f2782f2a0ec3426b8ac1e4bc46.zip
separate delays
-rw-r--r--sandman.command12
1 files changed, 6 insertions, 6 deletions
diff --git a/sandman.command b/sandman.command
index adfe85e..18f2190 100644
--- a/sandman.command
+++ b/sandman.command
@@ -1,16 +1,16 @@
#!/usr/bin/env bash
-DELAY=120
+ON_DELAY=20
+OFF_DELAY=20
if [[ $USER != "root" ]]; then
echo "This must be run as root"
exit 1
fi
-osascript -e "delay $DELAY"
-TIMESTAMP=$(php -r "echo date('H:i:s', time() + $DELAY);")
-pmset repeat poweron MTWRFSU $TIMESTAMP
+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
-osascript -e 'tell application "Finder" to shut down'
-exit 0
+shutdown -h now