From 5f264e7f60fa55b651c113131f552c0b2d68dea8 Mon Sep 17 00:00:00 2001 From: Craig Date: Fri, 10 Jan 2020 01:28:21 +0000 Subject: [PATCH] add times to startup and shutdown scripts. --- shutdown.sh | 5 +++-- startup.sh | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/shutdown.sh b/shutdown.sh index 28c2e82..4423c4c 100755 --- a/shutdown.sh +++ b/shutdown.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bas logDate=$(date '+%Y-%m-%dT%TZ') logFile="/home/lm-1/logs/shutdown-logs.txt" @@ -26,4 +26,5 @@ getApiUrl curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "off", "time": "'${logDate}'", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' "${apiURL}" -shutdown now \ No newline at end of file +sleep 5 +shutdown now diff --git a/startup.sh b/startup.sh index 1c561cc..c710e67 100755 --- a/startup.sh +++ b/startup.sh @@ -1,5 +1,7 @@ #!/bin/bash +sleep 40 + logDate=$(date '+%Y-%m-%dT%TZ') logFile="/home/lm-1/logs/start-logs.txt" @@ -24,4 +26,7 @@ EOF logStatusChange getApiUrl -curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "on", "time": "'${logDate}'", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' "${apiURL}" +curl -S -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "on", "time": "'${logDate}'", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' "${apiURL}" + +sleep 10 +sudo python /home/lm-1/repos/light-meter/cli_meter.py