From 5a6777379c6da389df145aca6c679f8eeabd2108 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 23 Feb 2010 12:19:09 +0200 Subject: sandman root fix --- sandman.command | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sandman.command b/sandman.command index 7942069..adfe85e 100644 --- a/sandman.command +++ b/sandman.command @@ -1,14 +1,16 @@ #!/usr/bin/env bash +DELAY=120 + 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);") +TIMESTAMP=$(php -r "echo date('H:i:s', time() + $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" +osascript -e 'tell application "Finder" to shut down' exit 0 -- cgit v1.2.3