aboutsummaryrefslogtreecommitdiffstats
path: root/sandman.command
diff options
context:
space:
mode:
Diffstat (limited to 'sandman.command')
-rw-r--r--sandman.command17
1 files changed, 17 insertions, 0 deletions
diff --git a/sandman.command b/sandman.command
new file mode 100644
index 0000000..5dca427
--- /dev/null
+++ b/sandman.command
@@ -0,0 +1,17 @@
+#! /usr/bin/env bash
+if [[ $USER != "root" ]]; then
+ echo "This must be run as root"
+ exit 1
+fi
+
+ROOTPW="1234"
+DELAY=120
+LOGFILE=~/Desktop/sandman.command.log
+
+osascript -e "delay $DELAY"
+TIMESTAMP=$(php -r "echo date ('H:i:s"', time() + $DELAY);")
+echo $ROOTPW | sudo -S 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