aboutsummaryrefslogtreecommitdiffstats
path: root/poweron.command
diff options
context:
space:
mode:
Diffstat (limited to 'poweron.command')
-rwxr-xr-x[-rw-r--r--]poweron.command15
1 files changed, 8 insertions, 7 deletions
diff --git a/poweron.command b/poweron.command
index be844e1..5dae15c 100644..100755
--- a/poweron.command
+++ b/poweron.command
@@ -2,16 +2,17 @@
ON_DELAY=20
OFF_DELAY=20
-LOGFILE=~/Desktop/powereon.command.log
+LOGFILE=~/Desktop/poweron.command.log
if [[ $USER != "root" ]]; then
- echo "This must be run as root"
- exit 1
+ echo "This must be run as root"
+ exit 1
fi
-sleep $ON_DELAY
-TIMESTAMP=$(php -r "echo @date('H:i:s', time() + ${OFF_DELAY});")
+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
+echo -n $(date "+%d.%m.%y @ %H:%I:%S") >> ${LOGFILE}
+echo " " $(wc -l $LOGFILE) >> ${LOGFILE}
shutdown -h now